Skip to content

Commit eabda19

Browse files
committed
Use the colorspace when writing images that have a color map in the pnm coder
1 parent b7f3b3b commit eabda19

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

coders/pnm.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1709,6 +1709,13 @@ static MagickBooleanType WritePNMImage(const ImageInfo *image_info,Image *image)
17091709
image->rows);
17101710
(void) WriteBlobString(image,buffer);
17111711
quantum_type=GetQuantumType(image,&image->exception);
1712+
if (quantum_type == IndexQuantum)
1713+
{
1714+
if (image->colorspace == CMYKColorspace)
1715+
quantum_type=CMYKQuantum;
1716+
else if (image->colorspace == GRAYColorspace)
1717+
quantum_type=GrayQuantum;
1718+
}
17121719
switch (quantum_type)
17131720
{
17141721
case CMYKQuantum:

0 commit comments

Comments
 (0)