2007.11.23 18:03 "[Tiff] Bug in _TIFFFindFieldInfo and some DNG tags in 3.8.2", by Antonio Scuri
The DNG tags TIFFTAG_BLACKLEVEL, TIFFTAG_DEFAULTCROPSIZE and TIFFTAG_DEFAULTCROPORIGIN, can be SHORT, LONG or RATIONAL. But in a test file that is LONG, libTIFF is interpreting always as RATIONAL since TIFFFindFieldInfo is using the first definition found.
The problem is in the code:
if (fip->field_tag == tag &&
(dt == TIFF_ANY || fip->field_type == dt))
return (tif->tif_foundfield = fip);
It exists inside an "else" of (dt != TIFF_ANY), so it is ignoring the second test always.
In libTIFF 4.0 this implementation is completely different, so I don't know if this bug report is relevant or not. And I did not test it with version 4.0, so I also don't know if it is fixed. If anyone needs a test image, please let me know.