From 176b29a003f11fd934137871d574995319408665 Mon Sep 17 00:00:00 2001 From: cristy Date: Thu, 21 Jun 2012 13:35:15 +0000 Subject: [PATCH] --- coders/miff.c | 2 +- coders/mpc.c | 2 +- coders/png.c | 8 ++++++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/coders/miff.c b/coders/miff.c index 5d7b5c99c..30b4b4d91 100644 --- a/coders/miff.c +++ b/coders/miff.c @@ -688,7 +688,7 @@ static Image *ReadMIFFImage(const ImageInfo *image_info, MagickFalse,options); if (colorspace < 0) break; - image->colorspace=(ColorspaceType) colorspace; + (void) SetImageColorspace(image,(ColorspaceType) colorspace, exception); break; } if (LocaleCompare(keyword,"compression") == 0) diff --git a/coders/mpc.c b/coders/mpc.c index 0b7112279..429ce79b9 100644 --- a/coders/mpc.c +++ b/coders/mpc.c @@ -388,7 +388,7 @@ static Image *ReadMPCImage(const ImageInfo *image_info,ExceptionInfo *exception) MagickFalse,options); if (colorspace < 0) break; - image->colorspace=(ColorspaceType) colorspace; + (void) SetImageColorspace(image,(ColorspaceType) colorspace, exception); break; } if (LocaleCompare(keyword,"compression") == 0) diff --git a/coders/png.c b/coders/png.c index f3d83d101..bc9c4dfb9 100644 --- a/coders/png.c +++ b/coders/png.c @@ -2280,6 +2280,14 @@ static Image *ReadOnePNGImage(MngInfo *mng_info, image->depth=ping_bit_depth; image->depth=GetImageQuantumDepth(image,MagickFalse); image->interlace=ping_interlace_method != 0 ? PNGInterlace : NoInterlace; + if (((int) ping_color_type == PNG_COLOR_TYPE_GRAY) || + ((int) ping_color_type == PNG_COLOR_TYPE_GRAY_ALPHA)) + { + image->rendering_intent=UndefinedIntent; + image->gamma=1.000; + (void) ResetMagickMemory(&image->chromaticity,0, + sizeof(image->chromaticity)); + } if (logging != MagickFalse) { (void) LogMagickEvent(CoderEvent,GetMagickModule(), -- 2.40.0