Author Topic: IPTC Category character limit  (Read 4969 times)

Offline Ethan Welty

  • Member
  • **
  • Posts: 82
    • View Profile
    • Ethan Welty Photography
IPTC Category character limit
« on: November 20, 2008, 11:29:01 PM »
Not so much a bug but an annoyance.

I've been using the Category field to denote what (stock) collection a particular image is exclusively distributed by. I noticed that it sometimes (not always) got chopped to three characters if that image, as a tif, went through Photoshop and got resaved or saved to a new file. After some research, turns out the official character limit for that field is 3.

Maybe you could impose that limit in PM so that compatibility is enforced and users don't have bad surprises later?
Just a thought.

Cheers,
Ethan

Offline nmf

  • Member
  • **
  • Posts: 71
    • View Profile
Re: IPTC Category character limit
« Reply #1 on: November 21, 2008, 02:12:41 AM »
I was just about to add a similar query re the Rights Usage and Special Instructions fields. I add my Rights Usage info into both fields as with the former being XMP I recall Kirk posting this may not be read by all software. However I have found that under various circumstances, such as when saving images to a lower resolution, the text can become truncated so only part of the relevant info is made available to the client. Even though this is only by a few characters with all the legal mumbo jumbo that we now have to include to give us more strength in protecting our copyright this could prove to be crucial. (for the US based you are the only country who require registration of images. For the rest it comes down to images being clearly marked in recognisable forms as being copyrighted and this may become even more relevant with the what appears to be impending Orphan Works Bill)

Clearly if this is due to circumstances beyond your control (eg an xmp restriction or as in the original posters query, Photoshop) then I appreciate there is nothing you can do to help. However if it is due to the design of PhotoMechanic could you also please review the character limits of these fields.

I have just realised the Copyright field will hold a longer caption (Doh!) and will run some tests to see if the full wording I need to include can be retained throughout my uses and reappears in all the right boxes in the fields as required. (I think I must have just followed the templates in yours and other guides for using the IPTC pad) However I still feel a review of character limits may be useful for the reasons stated in my first paragraph.

Thank you.

Offline dennis

  • President
  • Camera Bits Staff
  • Sr. Member
  • *****
  • Posts: 462
    • View Profile
    • Camera Bits, Inc.
Re: IPTC Category character limit
« Reply #2 on: November 21, 2008, 12:40:36 PM »
Ethan,

The IPTC specification does define restrictions on the length of various fields (e.g. 32 "octets" for photographer, title, city, state, credit source, transmission reference; 64 "octets" for object name, edit status, country; 2000 "octets" for caption), although these limits are often ignored by software because there isn't much of a reason to limit the lengths these days when memory is plentiful.  The one obvious exception is the Category field which is limited (as you discovered) to 3 "octets".  An "octet" is a byte (8 bits).  The IPTC specification also says that only the caption field can contain linefeeds and carriage-returns.

This gets complicated by the fact that one can enter UTF-8 (Unicode) into the IPTC-IIM.  With UTF-8, a single "character" can take several bytes.  So the limit of 32 "octets" for, say, photographer could be troublesome because it could be much fewer "characters".

The XMP specification doesn't have these limits (other than the Category field limit of 3 chars).  That is why Photoshop will let you enter longer values than the IPTC-IIM limits in File Info; for example, more than 32 characters for credit.  However, if you look at the IPTC-IIM data it will be truncated, but the XMP will not be truncated.  You can try this yourself and tell Photo Mechanic to load IPTC before XMP to see the truncation, or XMP before IPTC to see the full length values.  However, Photoshop does allow linefeeds and carriage-returns in several fields other than Caption to be saved in the IPTC-IIM which is technically a no-no.

So, we could add strict truncation of values to Photo Mechanic I suppose, but it would have to be a preference that you would need to enable since most people would not want this limitation.  Should it also strip linefeeds and carriage-returns in all fields other than Caption?  Should the limit be "octets" (bytes) when using UTF-8 (and if so we may need to truncate to fewer than the limited number of bytes to make sure that the last UTF-8 character is complete)?  How picky do you want to be?

Again, the Category field is special and I agree we should limit this to 3 chars period (again, what about UTF-8?).

--dennis


Offline Ethan Welty

  • Member
  • **
  • Posts: 82
    • View Profile
    • Ethan Welty Photography
Re: IPTC Category character limit
« Reply #3 on: November 21, 2008, 04:57:02 PM »
I would not have suspected the full story was quite that complicated, but I'm not that surprised. One must tread lightly in the world of metadata. Thank you for the detailed rundown, Dennis.