From: cristy Date: Sat, 12 May 2012 23:30:43 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~5608 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7a201993942f7c27b72d4304c6c3fc825c166182;p=imagemagick --- diff --git a/MagickCore/colorspace-private.h b/MagickCore/colorspace-private.h index 6bc12ccb2..7be53c231 100644 --- a/MagickCore/colorspace-private.h +++ b/MagickCore/colorspace-private.h @@ -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) { diff --git a/PerlMagick/t/filter.t b/PerlMagick/t/filter.t index 6aeb6ae89..c7859ce43 100644 --- a/PerlMagick/t/filter.t +++ b/PerlMagick/t/filter.t @@ -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); diff --git a/PerlMagick/t/write.t b/PerlMagick/t/write.t index 0c6a73f80..072aa3485 100644 --- a/PerlMagick/t/write.t +++ b/PerlMagick/t/write.t @@ -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; diff --git a/coders/pnm.c b/coders/pnm.c index 2677656f2..609d99ef8 100644 --- a/coders/pnm.c +++ b/coders/pnm.c @@ -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)) {