From: cristy Date: Wed, 8 Feb 2012 01:01:05 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~6225 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=96c4fcb68116776d031ebccc0e923c24d07561f1;p=imagemagick --- diff --git a/coders/gif.c b/coders/gif.c index cf640a833..3a1fd7753 100644 --- a/coders/gif.c +++ b/coders/gif.c @@ -1220,6 +1220,7 @@ static Image *ReadGIFImage(const ImageInfo *image_info,ExceptionInfo *exception) Read image attributes. */ image->storage_class=PseudoClass; + image->colorspace=sRGBColorspace; image->compression=LZWCompression; page.x=(ssize_t) ReadBlobLSBShort(image); page.y=(ssize_t) ReadBlobLSBShort(image); @@ -1227,10 +1228,9 @@ static Image *ReadGIFImage(const ImageInfo *image_info,ExceptionInfo *exception) image->rows=ReadBlobLSBShort(image); image->depth=8; flag=(unsigned char) ReadBlobByte(image); - image->interlace=BitSet((int) flag,0x40) != 0 ? GIFInterlace : - NoInterlace; - image->colors=BitSet((int) flag,0x80) == 0 ? global_colors : - one << ((size_t) (flag & 0x07)+1); + image->interlace=BitSet((int) flag,0x40) != 0 ? GIFInterlace : NoInterlace; + image->colors=BitSet((int) flag,0x80) == 0 ? global_colors : one << + ((size_t) (flag & 0x07)+1); if (opacity >= (ssize_t) image->colors) opacity=(-1); image->page.width=page.width; @@ -1288,8 +1288,8 @@ static Image *ReadGIFImage(const ImageInfo *image_info,ExceptionInfo *exception) /* Read local colormap. */ - colormap=(unsigned char *) AcquireQuantumMemory(image->colors, - 3*sizeof(*colormap)); + colormap=(unsigned char *) AcquireQuantumMemory(image->colors,3* + sizeof(*colormap)); if (colormap == (unsigned char *) NULL) { global_colormap=(unsigned char *) RelinquishMagickMemory( diff --git a/coders/jpeg.c b/coders/jpeg.c index e3d4b4b00..b49a4e4e4 100644 --- a/coders/jpeg.c +++ b/coders/jpeg.c @@ -1052,6 +1052,8 @@ static Image *ReadJPEGImage(const ImageInfo *image_info, else if (jpeg_info.out_color_space == JCS_CMYK) image->colorspace=CMYKColorspace; + else + image->colorspace=sRGBColorspace; /* Set image resolution. */ diff --git a/coders/png.c b/coders/png.c index 1882714ad..e682036f3 100644 --- a/coders/png.c +++ b/coders/png.c @@ -2346,6 +2346,7 @@ static Image *ReadOnePNGImage(MngInfo *mng_info, if (png_get_sRGB(ping,ping_info,&intent)) { + image->colorspace=sRGBColorspace; image->rendering_intent=Magick_RenderingIntent_from_PNG_RenderingIntent (intent); @@ -3573,11 +3574,11 @@ static Image *ReadOnePNGImage(MngInfo *mng_info, #if defined(PNG_sRGB_SUPPORTED) if (png_get_valid(ping,ping_info,PNG_INFO_sRGB)) { + image->colorspace=sRGBColorspace; (void) FormatLocaleString(msg,MaxTextExtent, - "intent=%d (See Rendering intent)", - (int) intent); + "intent=%d (See Rendering intent)", (int) intent); (void) SetImageProperty(image,"png:sRGB ",msg, - exception); + exception); } #endif