LAB colorspace recognized as RGB

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
lyuan

LAB colorspace recognized as RGB

Post by lyuan »

ImageMagick 6.3.4, alway indicated the LAB tif file as RGB color space
identify -format '%r' "00968_2003_002_PR LAB.tif"
'DirectClassRGB'
lyuan

Re: LAB colorspace recognized as RGB

Post by lyuan »

I fixed it:

1. file coders\tiff.c(551)
static Image *ReadTIFFImage(const ImageInfo *image_info,
ExceptionInfo *exception)
{
...
if (photometric == PHOTOMETRIC_SEPARATED)
image->colorspace=CMYKColorspace;
//Lyuan added to set the LabColor Space
if (photometric == PHOTOMETRIC_CIELAB)
image->colorspace=LABColorspace;
//Lyuan end

(void) TIFFGetFieldDefaulted(tiff,TIFFTAG_SAMPLESPERPIXEL,
....
}

2. magick\colorspace.c(986):
MagickExport MagickBooleanType TransformRGBImage(Image *image,
const ColorspaceType colorspace)
{
...
switch (colorspace)
{
case GRAYColorspace:
case LABColorspace: //Lyuan Added
case Rec601LumaColorspace:
case Rec709LumaColorspace:
case RGBColorspace:
case TransparentColorspace:
case UndefinedColorspace:
return(MagickTrue);

...
}
Post Reply