ImageMagick 6.3.4, alway indicated the LAB tif file as RGB color space
identify -format '%r' "00968_2003_002_PR LAB.tif"
'DirectClassRGB'
LAB colorspace recognized as RGB
Re: LAB colorspace recognized as RGB
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);
...
}
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);
...
}