Moved call JPEGSetImageQuality and JPEGSetImageSamplingFactor. The information is...
authorDirk Lemstra <dirk@git.imagemagick.org>
Sun, 15 Apr 2018 18:11:40 +0000 (20:11 +0200)
committerDirk Lemstra <dirk@git.imagemagick.org>
Sun, 15 Apr 2018 18:11:40 +0000 (20:11 +0200)
coders/jpeg.c

index 3165154bbedb0160438339158ff66eeda5001e89..efff0427df893d1e31cf2cacb72d69ecd2d69073 100644 (file)
@@ -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))
     {