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
June 2010

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

2010.06.12 07:36 "libtiff and IPTC tag", by Andreas Kleinert
2010.06.12 15:52 "Re: libtiff and IPTC tag", by Lee Howard
2010.06.12 17:49 "Re: libtiff and IPTC tag", by Andreas Kleinert
2010.06.14 06:09 "Re: libtiff and IPTC tag", by Joris Van Damme

2010.06.14 06:09 "Re: libtiff and IPTC tag", by Joris Van Damme

Andreas,

> However in tif_dirinfo.c within TIFFFieldInfo it is defined that
> libtiff expects LONG for TIFFTAG_RICHTIFFIPTC (custom field)...

This is the story of the egg and the many, many chickens.

Originally, there was one manufacturer that got it wrong, used LONG while 
the data is of mixed datatype, and therefore only makes sense as BYTE or 
UNDEFINED on the TIFF level. Adobe chose to duplicate that mistake, so as to 
remain compatible. LibTiff chose to duplicate Adobe's mistate, so as to 
remain compatible. As many chickens were hatched from that very first egg, 
endianness issues became aparant. Some brew complicated code to correct 
that, so as to remain compatible... But often that sort of code is either 
absent, or not working fully correctly. Hence, the attempts to remain 
compatible, turned out at least partly futile.

- The best way to write, is using BYTE or UNDEFINED.
- The best way to read, is interpret BYTE or UNDEFINED as expected.
- If datatype is LONG instead, read in your normal way (which probably 
includes byteswapping if endianness of file and machine don't match). Next 
try and interpret the data. If it doesn't make sense as valid IPTC data, 
byteswap it again, and retry interpreting it.


Best regards,

Joris