2012.09.07 15:27 "[Tiff] DNGPrivateData tag in 4.0.x", by John Evans

Hi folks, I'm seeing an issue in the 4.0.x series that is not present in 3.9.5. The issue seems to arise on DNG files created by Adobe DNG Converter, specifically in regards to the DNGPrivateData tag (50740).

On one such file, the tag data consists of 111748 bytes. If one runs tiffinfo as compiled from the current cvs snapshot agains this file, libtiff will refuse to read the DNGPrivateData tag and instead print out this error message

TIFFFetchNormalTag: Incorrect count for "DNGPrivateData"; tag ignored.

In 3.9.5, it looks like the entire sequence of bytes is printed.

It looks like the change in behavior comes in tif_dirread.c down around lines 4999-5000, which read

4999                 if (dp->tdir_count>0xFFFF)
5000                     err=TIFFReadDirEntryErrCount;

It seems that this would limit the length of a tag such as DNGPrivateData to 65535? Is this intended?

I hacked a smaller example TIFF file that can be found at http://mexcdf.sourceforge.net/ngc24am.tif