]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Tue, 3 Dec 2013 12:25:54 +0000 (12:25 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Tue, 3 Dec 2013 12:25:54 +0000 (12:25 +0000)
coders/jpeg.c

index a3ec45efaae2053989ccce3a370c9c283a95c009..721a07ccdf67c1241a52e016678ece93b816d579 100644 (file)
@@ -1022,7 +1022,6 @@ static Image *ReadJPEGImage(const ImageInfo *image_info,
     *p;
 
   size_t
-    precision,
     units;
 
   ssize_t
@@ -1134,7 +1133,6 @@ static Image *ReadJPEGImage(const ImageInfo *image_info,
         (void) LogMagickEvent(CoderEvent,GetMagickModule(),
           "Scale factor: %.20g",(double) scale_factor);
     }
-  precision=(size_t) jpeg_info.data_precision;
 #if (JPEG_LIB_VERSION >= 61) && defined(D_PROGRESSIVE_SUPPORTED)
 #if defined(D_LOSSLESS_SUPPORTED)
   image->interlace=jpeg_info.process == JPROC_PROGRESSIVE ?
@@ -2786,14 +2784,14 @@ static MagickBooleanType WriteJPEGImage(const ImageInfo *image_info,
             /*
               Convert DirectClass packets to contiguous CMYK scanlines.
             */
-            *q++=(JSAMPLE) (4095-(ScaleQuantumToShort(
-              GetPixelRed(image,p))/scale));
-            *q++=(JSAMPLE) (4095-(ScaleQuantumToShort(
-              GetPixelGreen(image,p))/scale));
-            *q++=(JSAMPLE) (4095-(ScaleQuantumToShort(
-              GetPixelBlue(image,p))/scale));
-            *q++=(JSAMPLE) (4095-(ScaleQuantumToShort(
-              GetPixelBlack(image,p))/scale));
+            *q++=(JSAMPLE) (ScaleQuantumToShort(QuantumRange-
+              GetPixelRed(image,p))/scale);
+            *q++=(JSAMPLE) (ScaleQuantumToShort(QuantumRange-
+              GetPixelGreen(image,p))/scale);
+            *q++=(JSAMPLE) (ScaleQuantumToShort(QuantumRange-
+              GetPixelBlue(image,p))/scale);
+            *q++=(JSAMPLE) (ScaleQuantumToShort(QuantumRange-
+              GetPixelBlack(image,p))/scale);
             p+=GetPixelChannels(image);
           }
           (void) jpeg_write_scanlines(&jpeg_info,scanline,1);