From 8756b3895b6cb2be5930324ec973c8590ef2d29e Mon Sep 17 00:00:00 2001 From: DarthSim Date: Thu, 28 Sep 2017 13:59:59 +0600 Subject: [PATCH] Remove reundant colorspace conversion --- vips.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/vips.h b/vips.h index a16b74d5..de9cc775 100644 --- a/vips.h +++ b/vips.h @@ -146,8 +146,10 @@ vips_process_image(VipsImage **img, int resize, double scale, int crop, int smar } } - err = vips_colourspace_go(*img, &tmp, VIPS_INTERPRETATION_sRGB); - swap_and_clear(img, tmp); + if (vips_image_guess_interpretation(*img) != VIPS_INTERPRETATION_sRGB) { + err = vips_colourspace_go(*img, &tmp, VIPS_INTERPRETATION_sRGB); + swap_and_clear(img, tmp); + } return err; }