A tiff file without the TIFFTAG_PHOTOMETRIC tag will fail to load with ImproperImageHeader Exception.
line 1375 in coders\tiff.c initializes:
photometric=PHOTOMETRIC_RGB;
but the call in line 1378:
(TIFFGetFieldDefaulted(tiff,TIFFTAG_PHOTOMETRIC,&photometric) != 1)
does not use that,
It has a case statement for the defaults which does not have a case for "TIFFTAG_PHOTOMETRIC"
Adding the following case at line 299 in tiff\libtiff\tif_aux.c fixes the issue.
case TIFFTAG_PHOTOMETRIC:
*va_arg(ap, uint16 *) = PHOTOMETRIC_RGB;
return (1);
Tiff image without TIFFTAG_PHOTOMETRIC won't load
Re: Tiff image without TIFFTAG_PHOTOMETRIC won't load
TIFFTAG_PHOTOMETRIC is required field. There is no default. See https://www.awaresystems.be/imaging/tif ... ation.html