From: cristy Date: Tue, 3 Dec 2013 12:25:54 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~3066 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0b22887a75d42099fb43063fd04418b5611aaa44;p=imagemagick --- diff --git a/coders/jpeg.c b/coders/jpeg.c index a3ec45efa..721a07ccd 100644 --- a/coders/jpeg.c +++ b/coders/jpeg.c @@ -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);