]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Sat, 12 May 2012 23:30:43 +0000 (23:30 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Sat, 12 May 2012 23:30:43 +0000 (23:30 +0000)
MagickCore/colorspace-private.h
PerlMagick/t/filter.t
PerlMagick/t/write.t
coders/pnm.c

index 6bc12ccb2460ac7d09981c6d85668b37eac4ac5f..7be53c2316f0bf452efde51c23d5d5ce8dd8d19e 100644 (file)
@@ -59,6 +59,14 @@ static inline void ConvertRGBToCMYK(PixelInfo *pixel)
   pixel->black=QuantumRange*black;
 }
 
+static inline MagickBooleanType IsCMYKColorspace(
+  const ColorspaceType colorspace)
+{
+  if (colorspace == CMYKColorspace)
+    return(MagickTrue);
+  return(MagickFalse);
+}
+
 static inline MagickBooleanType IsGrayColorspace(
   const ColorspaceType colorspace)
 {
index 6aeb6ae89c87be7a8ddab905ded9ef6d70b80f52..c7859ce4395d7cbd5be1ac08e837ceb166346634 100644 (file)
@@ -60,7 +60,7 @@ testFilterCompare('input.miff', "fuzz=>$fuzz", 'reference/filter/Colorize.miff',
 testFilterCompare('input.miff',  q//, 'reference/filter/Contrast.miff', 'Contrast', q//, 0.0, 0.0);
 ++$test;
 
-testFilterCompare('input.miff',  q//, 'reference/filter/Convolve.miff', 'Convolve', q/[0.125, 0.125, 0.125, 0.125, 1, 0.125, 0.125, 0.125, 0.125]/, 0.09, 0.0);
+testFilterCompare('input.miff',  q//, 'reference/filter/Convolve.miff', 'Convolve', q/[0.0625, 0.0625, 0.0625, 0.0625, 0.5, 0.0625, 0.0625, 0.0625, 0.0625]/, 0.09, 0.0);
 ++$test;
 
 testFilterCompare('input.miff',  q//, 'reference/filter/Crop.miff', 'Crop', q/geometry=>'80x80+5+10'/, 0.0, 0.0);
index 0c6a73f80c35398ce289d8ad70322fbf43a81530..072aa3485ffa1c0585bf5abaf655027a46f9ad81 100644 (file)
@@ -137,7 +137,7 @@ print("Portable pixmap format (color), ASCII format ...\n");
 testReadWrite( 'PPM:input_p3.ppm',
   'PPM:output_p3.ppm',
   q/compression=>'None'/,
-  '6a4a257921582768b774aeeac549b7c0c0b51f665395eddf921cce53a0ad2a33');
+  '34f7d6043e6c578a0959b95f7b707720b5b415360cf5b8710097b4cdfbd0ade5');
 
 print("Portable graymap format (gray scale), binary format ...\n");
 ++$test;
index 2677656f2a6222099c0103fa3cfafaad41f3c57f..609d99ef8bf6be295ac8f42a720fbf92c5a138ce 100644 (file)
@@ -372,16 +372,20 @@ static Image *ReadPNMImage(const ImageInfo *image_info,ExceptionInfo *exception)
           if (LocaleCompare(keyword,"TUPLTYPE") == 0)
             {
               if (LocaleCompare(value,"BLACKANDWHITE") == 0)
-                quantum_type=GrayQuantum;
+                {
+                  SetImageColorspace(image,GRAYColorspace,exception);
+                  quantum_type=GrayQuantum;
+                }
               if (LocaleCompare(value,"BLACKANDWHITE_ALPHA") == 0)
                 {
-                  quantum_type=GrayAlphaQuantum;
+                  SetImageColorspace(image,GRAYColorspace,exception);
                   image->matte=MagickTrue;
+                  quantum_type=GrayAlphaQuantum;
                 }
               if (LocaleCompare(value,"GRAYSCALE") == 0)
                 {
-                  SetImageColorspace(image,GRAYColorspace,exception);
                   quantum_type=GrayQuantum;
+                  SetImageColorspace(image,GRAYColorspace,exception);
                 }
               if (LocaleCompare(value,"GRAYSCALE_ALPHA") == 0)
                 {
@@ -391,19 +395,19 @@ static Image *ReadPNMImage(const ImageInfo *image_info,ExceptionInfo *exception)
                 }
               if (LocaleCompare(value,"RGB_ALPHA") == 0)
                 {
-                  quantum_type=RGBAQuantum;
                   image->matte=MagickTrue;
+                  quantum_type=RGBAQuantum;
                 }
               if (LocaleCompare(value,"CMYK") == 0)
                 {
-                  quantum_type=CMYKQuantum;
                   SetImageColorspace(image,CMYKColorspace,exception);
+                  quantum_type=CMYKQuantum;
                 }
               if (LocaleCompare(value,"CMYK_ALPHA") == 0)
                 {
-                  quantum_type=CMYKAQuantum;
                   SetImageColorspace(image,CMYKColorspace,exception);
                   image->matte=MagickTrue;
+                  quantum_type=CMYKAQuantum;
                 }
             }
           if (LocaleCompare(keyword,"width") == 0)
@@ -527,6 +531,7 @@ static Image *ReadPNMImage(const ImageInfo *image_info,ExceptionInfo *exception)
         /*
           Convert PNM image to pixel packets.
         */
+        SetImageColorspace(image,GRAYColorspace,exception);
         scale=(Quantum *) NULL;
         if (max_value != (1U*QuantumRange))
           {