From: cristy Date: Fri, 16 Apr 2010 23:34:02 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~9630 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0132ba87111c8ab77b0616164408efa9ca16f2a9;p=imagemagick --- diff --git a/coders/psd.c b/coders/psd.c index 22edbab93..7142b9642 100644 --- a/coders/psd.c +++ b/coders/psd.c @@ -574,8 +574,7 @@ static MagickBooleanType ReadPSDLayer(Image *image, if (compact_pixels == (unsigned char *) NULL) ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed", image->filename); - (void) ResetMagickMemory(compact_pixels,0,length* - sizeof(*compact_pixels)); + (void) ResetMagickMemory(compact_pixels,0,length*sizeof(*compact_pixels)); } for (y=0; y < (long) image->rows; y++) { @@ -800,6 +799,7 @@ static Image *ReadPSDImage(const ImageInfo *image_info,ExceptionInfo *exception) if (image->debug != MagickFalse) (void) LogMagickEvent(CoderEvent,GetMagickModule(), " ImageColorMap allocated"); + image->colorspace=GRAYColorspace; } if (image->debug != MagickFalse) (void) LogMagickEvent(CoderEvent,GetMagickModule(), @@ -1141,7 +1141,11 @@ static Image *ReadPSDImage(const ImageInfo *image_info,ExceptionInfo *exception) if (layer_info[i].visible == MagickFalse) layer_info[i].image->compose=NoCompositeOp; if (psd_info.mode == CMYKMode) - image->colorspace=CMYKColorspace; + layer_info[i].image->colorspace=CMYKColorspace; + if ((psd_info.mode == BitmapMode) || + (psd_info.mode == GrayscaleMode) || + (psd_info.mode == DuotoneMode)) + layer_info[i].image->colorspace=GRAYColorspace; for (j=0; j < (long) layer_info[i].channels; j++) if (layer_info[i].channel_info[j].type == -1) layer_info[i].image->matte=MagickTrue; diff --git a/magick/cache.c b/magick/cache.c index 4f39ee155..cdd9a6ce4 100644 --- a/magick/cache.c +++ b/magick/cache.c @@ -2231,8 +2231,6 @@ MagickExport Cache GetImagePixelCache(Image *image, */ image->taint=MagickTrue; image->type=UndefinedType; - if (image->colorspace == GRAYColorspace) - image->colorspace=RGBColorspace; if (ValidatePixelCacheMorphology(image) == MagickFalse) status=OpenPixelCache(image,IOMode,exception); } diff --git a/magick/identify.c b/magick/identify.c index deda22568..d8acd3b01 100644 --- a/magick/identify.c +++ b/magick/identify.c @@ -217,20 +217,6 @@ static int PrintChannelStatistics(FILE *file,const ChannelType channel, int status; - if (channel == AlphaChannel) - { - status=fprintf(file,StatisticsFormat,name,ClampToQuantum(scale* - (QuantumRange-channel_statistics[channel].minima)), - (QuantumRange-channel_statistics[channel].minima)/(double) QuantumRange, - ClampToQuantum(scale*(QuantumRange-channel_statistics[channel].maxima)), - (QuantumRange-channel_statistics[channel].maxima)/(double) QuantumRange, scale*(QuantumRange-channel_statistics[channel].mean), - (QuantumRange-channel_statistics[channel].mean)/(double) QuantumRange, - scale*channel_statistics[channel].standard_deviation, - channel_statistics[channel].standard_deviation/(double) QuantumRange, - channel_statistics[channel].kurtosis, - channel_statistics[channel].skewness); - return(status); - } status=fprintf(file,StatisticsFormat,name,ClampToQuantum(scale* channel_statistics[channel].minima),channel_statistics[channel].minima/ (double) QuantumRange,ClampToQuantum(scale*