AWARE [SYSTEMS] Imaging expertise for the Delphi developer
AWare Systems, Imaging expertise for the Delphi developer, Home TIFF and LibTiff Mailing List Archive

LibTiff Mailing List

TIFF and LibTiff Mailing List Archive
December 2004

Previous Thread
Next Thread

Previous by Thread
Next by Thread

Previous by Date
Next by Date

Contact

The TIFF Mailing List Homepage
This list is run by Frank Warmerdam
Archive maintained by AWare Systems



Valid HTML 4.01!



Thread

2004.12.02 18:07 "Having problems adding IPTC to a TIFF", by Roland Rabien
2004.12.02 18:30 "Re: Having problems adding IPTC to a TIFF", by Andrey Kiselev
2004.12.02 21:40 "Re: Having problems adding IPTC to a TIFF", by Roland Rabien
2004.12.06 22:52 "Re: Having problems adding IPTC to a TIFF", by Joris Van Damme
2004.12.07 02:08 "Re: Having problems adding IPTC to a TIFF", by Bob Friesenhahn
2004.12.07 02:53 "Re: Having problems adding IPTC to a TIFF", by Joris Van Damme
2004.12.07 04:13 "Re: Having problems adding IPTC to a TIFF", by Bob Friesenhahn
2004.12.07 04:27 "Re: Having problems adding IPTC to a TIFF", by Chris Cox
2004.12.07 09:11 "Re: Having problems adding IPTC to a TIFF", by Joris Van Damme
2004.12.07 20:29 "Re: Having problems adding IPTC to a TIFF", by Chris Cox
2004.12.07 20:51 "Re: Having problems adding IPTC to a TIFF", by Joris Van Damme
2004.12.07 22:14 "Re: Having problems adding IPTC to a TIFF", by Chris Cox
2004.12.07 09:12 "Re: Having problems adding IPTC to a TIFF", by Joris Van Damme
2004.12.07 10:34 "Re: Having problems adding IPTC to a TIFF", by Eric Vergnaud
2004.12.07 11:06 "Re: Having problems adding IPTC to a TIFF", by Joris Van Damme
2004.12.07 17:06 "Re: Having problems adding IPTC to a TIFF", by Eric Vergnaud
2004.12.07 17:16 "Re: Having problems adding IPTC to a TIFF", by Bob Friesenhahn
2004.12.07 20:45 "Re: Having problems adding IPTC to a TIFF", by Joris Van Damme
2004.12.07 22:16 "Re: Having problems adding IPTC to a TIFF", by Chris Cox
2004.12.07 22:26 "Re: Having problems adding IPTC to a TIFF", by Eric Vergnaud
2004.12.07 21:06 "Re: Having problems adding IPTC to a TIFF", by Gary Mcgath

2004.12.06 22:52 "Re: Having problems adding IPTC to a TIFF", by Joris Van Damme

> This problem should be fixed in CVS (i.e., in post-3.7.0 code). Please,
> try to fetch the most recent snapshot and test your code with it.

A while ago (http://www.asmail.be/msg0055489739.html), I mentioned that the IPTC
tag datatype, TIFF_LONG according to LibTiff code, was suspicious. Other sources
mentioned datatype TIFF_BYTE or TIFF_ASCII. Having in mind byte order issues, it
seemed strange that a tag could be defined as having either an 8bit or 32bit
datatype.

Thanks to Chris Losinger (Thanks, Chris!), I now have the data structure layout
of the IPTC data, which seemed not readily present in the specification. (Or
either I'm to stupid and/or lazy to wade through a lot of mystical stuff that is
not clearly preceded by data structures and such.) The data structure contains
byte values, word values and cardinal values that define a set of tags, each of
which has specific other data that can have any sort of structure. Thus, the
IPTC tag datatype should clearly be TIFF_UNDEFINED, or TIFF_BYTE which is
functionally the same.

I tested this newly acquired knowledge on some TIFFs. With some of them, it
makes perfect sense. Some others make sense only after unswapping the bytes, ie,
at some stage the data has incorrectly been byteswapped as if it were an array
of 32bit values which it is not. These others also typically have a too large
count. Clearly, these are written by LibTiff with a wrong datatype definition.

My questions are:
- Is the datatype corrected in this newer CVS version? Is that part of the
mentioned bugfix? If it is not, will you correct it so as to stop LibTiff
writing any more TIFFs with corrupted (!) IPTC data in the future?
- A quick and dirty method to see if IPTC tag data has been incorrectly
byteswapped, is testing the first byte. If it is not equal to 0x1C, then most
probably the fourth byte of the data is equal to 0x1C, and you need to unswap it
to recover the correct data. In that case, the tag count may be unreliable too,
so the reader needs to be build to read whatever it can up to the point where
the data stops making sense. Does such a robust reader that recovers from
LibTiff's data corruption seems sensible to you guys?

Joris Van Damme
info@awaresystems.be
http://www.awaresystems.be
Download your free TIFF tag viewer for windows here:
http://www.awaresystems.be/imaging/tiff/astifftagviewer.html