]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Fri, 16 Apr 2010 23:34:02 +0000 (23:34 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Fri, 16 Apr 2010 23:34:02 +0000 (23:34 +0000)
coders/psd.c
magick/cache.c
magick/identify.c

index 22edbab93abd5b9587ad3a99e17020f6f5db292f..7142b9642ef4950b609fdd991cec693628a5d189 100644 (file)
@@ -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;
index 4f39ee1558a2e36938bd24a0471d2eacc565b948..cdd9a6ce40a2904ca809f2022dfbd130bea772d6 100644 (file)
@@ -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);
     }
index deda2256829b0aeb9ac14a44475fa0cf1c46d904..d8acd3b0193a837baa8ea5adb8d92b0475b3b43e 100644 (file)
@@ -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*