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
October 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.10.03 22:20 "IPTC tags", by Gary Lawton
2004.10.03 22:45 "Re: IPTC tags", by Bob Friesenhahn
2004.10.03 23:04 "Re: IPTC tags", by Bob Friesenhahn
2004.10.04 21:47 "Re: IPTC tags", by Gary Lawton
2004.10.04 21:55 "Re: IPTC tags", by Bob Friesenhahn
2004.10.04 12:15 "Re: IPTC tags", by Joris Van Damme
2004.10.04 13:35 "Re: IPTC tags", by Joris Van Damme
2004.10.04 15:14 "Re: IPTC tags", by Bob Friesenhahn
2004.10.04 15:44 "Re: IPTC tags", by Joris Van Damme
2004.10.04 15:53 "Re: IPTC tags", by Bob Friesenhahn

2004.10.03 22:45 "Re: IPTC tags", by Bob Friesenhahn

On Sun, 3 Oct 2004, Gary Lawton wrote:
>
> I'm trying to work out how to read and write IPTC tags into TIFF images. I've 
> downloaded the specification for IIMv4 from 
> http://www.iptc.org/download/download.php?fn=IIMV4.1.pdf and I think that's 
> fairly clear how an IPTC record is structured.
>
> But... How does this relate to the libtiff Tag Reference guide at 
> http://www.awaresystems.be/imaging/tiff/tifftags.html ?? Is there a private 
> tag description for the IPTC information or is it held inside the Photoshop 
> Tag (ref 34377) ?
>
> Am I missing something obvious?

The tag for IPTC is TIFFTAG_RICHTIFFIPTC.  Note that the length of 
this tag is the length in 32-bit words so you must multiply by four to 
obtain bytes.

To obtain the tag:

TIFFGetField(tiff,TIFFTAG_RICHTIFFIPTC,&length,&value);
length *= 4; // bytes

To save the tag (length in bytes):

TIFFSetField(tiff,TIFFTAG_RICHTIFFIPTC,(uint32) length/4,(void *) value);

There is also the issue that the content may be byte-swapped (due to 
being written on a different-endian CPU) so you would need to do:

  if (TIFFIsByteSwapped(tiff))
         TIFFSwabArrayOfLong((uint32 *) value,length/4);

Yes, the Photoshop profile will also contain an IPTC tag.  That makes 
life more interesting. :-)

If there is no TIFFTAG_RICHTIFFIPTC tag but there is a 
TIFFTAG_PHOTOSHOP then a IPTC tag can still be obtained.

Bob
======================================
Bob Friesenhahn
bfriesen@simple.dallas.tx.us
http://www.simplesystems.org/users/bfriesen