From 019a8ce6bf4292f09fc17f86cf8343e9d55be117 Mon Sep 17 00:00:00 2001 From: Dirk Lemstra Date: Sun, 15 Apr 2018 20:11:40 +0200 Subject: [PATCH] Moved call JPEGSetImageQuality and JPEGSetImageSamplingFactor. The information is read from the header so we can use it when pinging the image. --- coders/jpeg.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/coders/jpeg.c b/coders/jpeg.c index 3165154bb..efff0427d 100644 --- a/coders/jpeg.c +++ b/coders/jpeg.c @@ -1330,6 +1330,11 @@ static Image *ReadJPEGImage(const ImageInfo *image_info, (void) LogMagickEvent(CoderEvent,GetMagickModule(),"Geometry: %dx%d", (int) jpeg_info.output_width,(int) jpeg_info.output_height); } + JPEGSetImageQuality(&jpeg_info,image); + JPEGSetImageSamplingFactor(&jpeg_info,image,exception); + (void) FormatLocaleString(value,MagickPathExtent,"%.20g",(double) + jpeg_info.out_color_space); + (void) SetImageProperty(image,"jpeg:colorspace",value,exception); if (image_info->ping != MagickFalse) { jpeg_destroy_decompress(&jpeg_info); @@ -1343,11 +1348,6 @@ static Image *ReadJPEGImage(const ImageInfo *image_info, return(DestroyImageList(image)); } (void) jpeg_start_decompress(&jpeg_info); - JPEGSetImageQuality(&jpeg_info,image); - JPEGSetImageSamplingFactor(&jpeg_info,image,exception); - (void) FormatLocaleString(value,MagickPathExtent,"%.20g",(double) - jpeg_info.out_color_space); - (void) SetImageProperty(image,"jpeg:colorspace",value,exception); if ((jpeg_info.output_components != 1) && (jpeg_info.output_components != 3) && (jpeg_info.output_components != 4)) { -- 2.50.1