2017.03.04 10:59 "[Tiff] started seeing breakage with libtiff", by John

2017.03.04 10:59 "[Tiff] started seeing breakage with libtiff", by John

Hello everyone,

Overnight I've started seeing problems with libtiff. It seems this patch has just been rolled out to Ubuntu:

http://bugzilla.maptools.org/show_bug.cgi?id=2590

This issues a warning if some tags are not NULL-terminated. However, libtiff itself can write tags which are not NULL-terminated, for example:

$ tiffcp -c jpeg k2a.tif x.tif

(where k2a.tif is an old uncompressed RGB strip tif I had handy) works fine. However I now can't read it back without a warning:

$ tiffcp x.tif y.tif

TIFFFetchNormalTag: Warning, ASCII value for tag "JPEGTables" does not end in null byte. Forcing it to be null.

JPEGLib: Warning, Premature end of JPEG file.

This causes problems for some other libraries, such as openslide, which seem to treat libtiff warnings as fatal.

Has anyone looked into this? What would be the best fix here? It looks like libtiff perhaps shouldn't check null-termination on JPEGTables.

John