The code below in the tiff.c file (ReadStripMethod, line 1466+) looks logically incorrect because (*p) is unsigned char and TIFFGetG, TIFFGetB and TIFFGetA will always return 0. Also it looks like p pointer should be increased by 4 bytes, not just 1...
Code: Select all
p=(unsigned char *) (((uint32 *) pixels)+image->columns*i);
for (x=0; x < (ssize_t) image->columns; x++)
{
SetPixelRed(q,ScaleCharToQuantum((unsigned char)
(TIFFGetR(*p))));
SetPixelGreen(q,ScaleCharToQuantum((unsigned char)
(TIFFGetG(*p))));
SetPixelBlue(q,ScaleCharToQuantum((unsigned char)
(TIFFGetB(*p))));
if (image->matte != MagickFalse)
SetPixelOpacity(q,ScaleCharToQuantum((unsigned char)
(TIFFGetA(*p))));
p++;
q++;
}