Project

General

Profile

IPTC tags in Photoshop File Info

Added by Scott Renton over 6 years ago

Hi folks,

First of all, can I just say how pleased I am to have discovered exiv2- it's been a huge help.

I have one query: I've run this a few times and to no avail. I want to put our photographers' contact details into the MD, and they will only be satisified if they can see it coming through on Photoshop File Info (I'm personally running Elements 10). I have got this working, insofar as at the raw XML I can see is:

<rdf:Description rdf:about="" 
            xmlns:Iptc4xmpCore="http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/">
         <Iptc4xmpCore:CiAdrCity>Edinburgh</Iptc4xmpCore:CiAdrCity>
         <Iptc4xmpCore:CiAdrPcode>EH8 9LJ</Iptc4xmpCore:CiAdrPcode>
         <Iptc4xmpCore:CiAdrExtradr>Centre for Research Collections, The University of Edinburgh, George Square</Iptc4xmpCore:CiAdrExtradr>
         <Iptc4xmpCore:CiAdrCtry>UK</Iptc4xmpCore:CiAdrCtry>
         <Iptc4xmpCore:CiTelWork>0131 650 8379</Iptc4xmpCore:CiTelWork>
         <Iptc4xmpCore:CiEmailWork>is-crc@ed.ac.uk</Iptc4xmpCore:CiEmailWork>
         <Iptc4xmpCore:CiUrlWork>http://www.lib.ed.ac.uk/resources/collections/crc/index.html</Iptc4xmpCore:CiUrlWork>
 </rdf:Description>
...but the corresponding tags (or what I think they should be) are all blank on the IPTC Extension tab (these being the ones under Location screenshotted in the attachment). It's possible these don't correspond to Xmp.iptc.CiAdrCity etc. If I am assigning these wrongly, does anyone know what they might be?

Thanks very much in advance!

Cheers

Scott


Replies (11)

RE: IPTC tags in Photoshop File Info - Added by Robin Mills over 6 years ago

Scott

Greetings to the University of Edinburgh from a retired Adobe Engineer from Largs, now living in Camberley.

I'm not too sure I know what you're discussing - however between us I think we can get to the bottom of this. I've got LightRoom 5.7 and opened an image and added my name and address to the IPTC section and saved it.I can also extract the IPTC data:

543 rmills@rmills-imac-2:~/Pictures/Photos/2015/April $ exiv2 -pi dsc_6435.jpg  
Iptc.Envelope.CharacterSet                   String      3  G
Iptc.Application2.RecordVersion              Short       1  4
Iptc.Application2.DateCreated                Date        8  2015-04-05
Iptc.Application2.TimeCreated                Time       11  22:15:13+00:00
Iptc.Application2.Byline                     String     11  Robin Mills
Iptc.Application2.BylineTitle                String     14  Build Engineer
544 rmills@rmills-imac-2:~/Pictures/Photos/2015/April $ 
And sniffing it the XMP shows (with the --grep ContactInfo filter) :
547 rmills@rmills-imac-2:~/Pictures/Photos/2015/April $ exiv2 -px -g ContactInfo dsc_6435.jpg 
Xmp.iptc.CreatorContactInfo                  XmpText     0  type="Struct" 
Xmp.iptc.CreatorContactInfo/Iptc4xmpCore:CiAdrCity XmpText    9  Camberley
Xmp.iptc.CreatorContactInfo/Iptc4xmpCore:CiAdrRegion XmpText     6  Surrey
Xmp.iptc.CreatorContactInfo/Iptc4xmpCore:CiAdrPcode XmpText     8  GU15 1ED
548 rmills@rmills-imac-2:~/Pictures/Photos/2015/April $ 
To change the City:
exiv2 -M'set Xmp.iptc.CreatorContactInfo/Iptc4xmpCore:CiAdrCity Largs, Ayrshire' dsc_6435.jpg
And another sniff into the xmp data gives us:
547 rmills@rmills-imac-2:~/Pictures/Photos/2015/April $ exiv2 -px -g ContactInfo dsc_6435.jpg 
Xmp.iptc.CreatorContactInfo                  XmpText     0  type="Struct" 
Xmp.iptc.CreatorContactInfo/Iptc4xmpCore:CiAdrCity XmpText    15  Largs, Ayrshire
Xmp.iptc.CreatorContactInfo/Iptc4xmpCore:CiAdrRegion XmpText     6  Surrey
Xmp.iptc.CreatorContactInfo/Iptc4xmpCore:CiAdrPcode XmpText     8  GU15 1ED
548 rmills@rmills-imac-2:~/Pictures/Photos/2015/April $
Armed with this insight, I hope you can reach your destination with too much pain. For sure, I don't want your photographers to be unhappy. Hell, they might even leave the United Kingdom in a huff.

If you want to dive a little deeper into what's going on here, you can dump and pretty print the XMP/xml with the recently added -pX option. You'll need to build the trunk for this feature.

542 rmills@rmills-imac-2:~/Pictures/Photos/2015/April $ exiv2 -pX dsc_6435.jpg  | xmllint -pretty 1 -
<?xml version="1.0"?>
<?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?>
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 5.5-c002 1.148022, 2012/07/15-18:06:45        ">
  <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
    <rdf:Description xmlns:xmp="http://ns.adobe.com/xap/1.0/" xmlns:aux="http://ns.adobe.com/exif/1.0/aux/" xmlns:photoshop="http://ns.adobe.com/photoshop/1.0/" xmlns:xmpMM="http://ns.adobe.com/xap/1.0/mm/" xmlns:stEvt="http://ns.adobe.com/xap/1.0/sType/ResourceEvent#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:Iptc4xmpCore="http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/" xmlns:crs="http://ns.adobe.com/camera-raw-settings/1.0/" rdf:about="" xmp:CreatorTool="Ver.1.00" xmp:ModifyDate="2015-04-05T22:15:13.80" xmp:CreateDate="2015-04-05T22:15:13.80" xmp:MetadataDate="2015-04-21T14:47:17+01:00" aux:SerialNumber="2567806" aux:LensInfo="180/10 2500/10 35/10 63/10" aux:Lens="18.0-250.0 mm f/3.5-6.3" aux:LensID="146" aux:ImageNumber="8327" aux:ApproximateFocusDistance="89/100" photoshop:DateCreated="2015-04-05T22:15:13.80" photoshop:AuthorsPosition="Build Engineer" xmpMM:DocumentID="4056CEA429B53A20D48401509AD299BD" xmpMM:OriginalDocumentID="4056CEA429B53A20D48401509AD299BD" xmpMM:InstanceID="xmp.iid:7266d038-0fa2-4ed4-ae98-27f520f57796" dc:format="image/jpeg" crs:RawFileName="dsc_6435.jpg">
      <xmpMM:History>
        <rdf:Seq>
          <rdf:li stEvt:action="saved" stEvt:instanceID="xmp.iid:7266d038-0fa2-4ed4-ae98-27f520f57796" stEvt:when="2015-04-21T14:47:17+01:00" stEvt:softwareAgent="Adobe Photoshop Lightroom 5.7 (Macintosh)" stEvt:changed="/metadata"/>
        </rdf:Seq>
      </xmpMM:History>
      <dc:creator>
        <rdf:Seq>
          <rdf:li>Robin Mills</rdf:li>
        </rdf:Seq>
      </dc:creator>
      <Iptc4xmpCore:CreatorContactInfo Iptc4xmpCore:CiAdrCity="Camberley" Iptc4xmpCore:CiAdrRegion="Surrey" Iptc4xmpCore:CiAdrPcode="GU15 1ED"/>
    </rdf:Description>
  </rdf:RDF>
</x:xmpmeta>
<?xpacket end="w"?>
543 rmills@rmills-imac-2:~/Pictures/Photos/2015/April $ 

RE: IPTC tags in Photoshop File Info - Added by Alan Pater over 6 years ago

As Robin's example shows, you need to write these properties in nested format:

 Xmp.iptc.CreatorContactInfo/Iptc4xmpCore:CiAdrCity
Not:
Xmp.Iptc4xmpCore.CiAdrCity

RE: IPTC tags in Photoshop File Info - Added by Robin Mills over 6 years ago

Alan: Isn't that what I said? To change the city:

exiv2 -M'set Xmp.iptc.CreatorContactInfo/Iptc4xmpCore:CiAdrCity Largs, Ayrshire' dsc_6435.jpg
And the xmp (using the --grep Con.. filter) becomes:
547 rmills@rmills-imac-2:~/Pictures/Photos/2015/April $ exiv2 -px -g ContactInfo dsc_6435.jpg 
Xmp.iptc.CreatorContactInfo                  XmpText     0  type="Struct" 
Xmp.iptc.CreatorContactInfo/Iptc4xmpCore:CiAdrCity XmpText    15  Largs, Ayrshire
Xmp.iptc.CreatorContactInfo/Iptc4xmpCore:CiAdrRegion XmpText     6  Surrey
Xmp.iptc.CreatorContactInfo/Iptc4xmpCore:CiAdrPcode XmpText     8  GU15 1ED
548 rmills@rmills-imac-2:~/Pictures/Photos/2015/April $

RE: IPTC tags in Photoshop File Info - Added by Robin Mills over 6 years ago

Whoops. I'm being stupid. Alan's saying be sure to use 'nested' format.

The simple way to get this to work for you is to use the tools (Elements, LightRoom, Bridge or whatever) to set the fields that interest you. Use exiv2 -px filename to discover the names of the tags. And then you can update them using exiv2 -M'set amazing-nested-tag-name value' filename

And we hope that happiness will follow. For sure we don't want an invasion of irate Scottish photographers (with or without their kilts).

Robin

RE: IPTC tags in Photoshop File Info - Added by Alan Pater over 6 years ago

To the "whatever" list of tools, please add digikam! I provided a patch to fix CreatorContactInfo nested properties in the digikam metadata editor last year.

PS: Robin, I hope that's not an animated gif ...

RE: IPTC tags in Photoshop File Info - Added by Robin Mills over 6 years ago

Alan:

Do you see it doing the highland fling?

Nope - not an animated gif. It was created with PhotoShop something (Elements 2.0, I think) about 10 years ago. It's a horrid little (255 colors) gif. 10 years ago, gif was the only common browser format which supported transparency.

And sure, let's add DigiKam to the list of respectable tools. Gilles isn't just the product owner and driver behind DigiKam, he also wrote a big chunk of Exiv2 before I joined the project.

Exiv2 is open source, cross platform and conforms to standards and should work well with most image products including Microsoft, Apple and other software vendors.

RE: IPTC tags in Photoshop File Info - Added by Scott Renton over 6 years ago

Hi Robin and Alan

First of all, great to hear I've inadvertently stumbled upon a fellow Jock. Our insanely pernickity photographer is actually a Kiwi, but she's got Scottish roots (and as she lives in a farm in Perthshire and commutes in every day, she's probably a damned sight more Scottish than I am). Glad you still get a chance to wear your kilt in Surrey, Robin!! I too am pleased it's not animated, but this is largely because I'm just a stranger that's wandered into this forum.

Thanks very much for the nesting advice both. Things looking better in a pr:

Xmp.iptc.CreatorContactInfo XmpText 0 type="Struct"
Xmp.iptc.CreatorContactInfo/Iptc4xmpCore:CiAdrCity XmpText 9 Edinburgh
Xmp.iptc.CreatorContactInfo/Iptc4xmpCore:CiAdrPcode XmpText 7 EH8 9LJ
Xmp.iptc.CreatorContactInfo/Iptc4xmpCore:CiAdrExtradr XmpText 75 Centre for Research Collections, The University of Edinburgh, George Square
Xmp.iptc.CreatorContactInfo/Iptc4xmpCore:CiAdrCtry XmpText 2 UK
Xmp.iptc.CreatorContactInfo/Iptc4xmpCore:CiTelWork XmpText 13 0131 650 8379
Xmp.iptc.CreatorContactInfo/Iptc4xmpCore:CiEmailWork XmpText 15
Xmp.iptc.CreatorContactInfo/Iptc4xmpCore:CiUrlWork XmpText 60 http://www.lib.ed.ac.uk/resources/collections/crc/index.html

and on the raw data in Photoshop
<rdf:Description rdf:about=""
xmlns:Iptc4xmpCore="http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/">
<Iptc4xmpCore:CreatorContactInfo rdf:parseType="Resource">
<Iptc4xmpCore:CiAdrCity>Edinburgh</Iptc4xmpCore:CiAdrCity>
<Iptc4xmpCore:CiAdrPcode>EH8 9LJ</Iptc4xmpCore:CiAdrPcode>
<Iptc4xmpCore:CiAdrExtradr>Centre for Research Collections, The University of Edinburgh, George Square</Iptc4xmpCore:CiAdrExtradr>
<Iptc4xmpCore:CiAdrCtry>UK</Iptc4xmpCore:CiAdrCtry>
<Iptc4xmpCore:CiTelWork>0131 650 8379</Iptc4xmpCore:CiTelWork>
<Iptc4xmpCore:CiEmailWork></Iptc4xmpCore:CiEmailWork>
<Iptc4xmpCore:CiUrlWork>http://www.lib.ed.ac.uk/resources/collections/crc/index.html&lt;/Iptc4xmpCore:CiUrlWork>
</Iptc4xmpCore:CreatorContactInfo>
</rdf:Description>

Thanks for the advice about setting values in the tools then displaying using exiv2. These are indeed not the fields I thought they were! They are:

Xmp.iptcExt.LocationCreated1/Iptc4xmpExt:Sublocation XmpText 4 erer
Xmp.iptcExt.LocationCreated1/Iptc4xmpExt:City XmpText 5 sdasa

So, it looks as though that's all I need to set them to, to get those bits to show. Shows the CreatorContactInfo was a bit of a red herring, but I've now realised that the IPTC tab was hidden, and thanks to the nesting advice, having shown it again, I see that's now in. So thank you very much.

Very grateful indeed for all your help- thanks for the speedy response.

Cheers again
Scott

RE: IPTC tags in Photoshop File Info - Added by Robin Mills over 6 years ago

Happy Users - that's what we want. It's amazing how interconnected everybody is today. Alan's in South America. You're in Edinburgh, your photographer is from NZ and I'm in England. And all of this has been fixed without picking up the phone.

Robin

RE: IPTC tags in Photoshop File Info - Added by Alan Pater over 6 years ago

Scott Renton wrote:

Thanks for the advice about setting values in the tools then displaying using exiv2. These are indeed not the fields I thought they were! They are:

Xmp.iptcExt.LocationCreated1/Iptc4xmpExt:Sublocation XmpText 4 erer
Xmp.iptcExt.LocationCreated1/Iptc4xmpExt:City XmpText 5 sdasa

Perhaps a look at the MWG guidelines would help decide which fields are needed. They make a distinction between “Location Created” and “Location Shown”.

- “Location Created”: This information describes the location where the image was
created, the location of the camera during shot creation. The typical case is when a
GPS receiver injects the current location into an image at shooting time (camera
location).
- “Location Shown”: This information describes the location of the main subject being
shown in an image. For example, a picture of Mount Fuji would be tagged with the
coordinates of where the mountain is located (subject location), although the picture
may have been taken from downtown Tokyo.

http://www.metadataworkinggroup.org/pdf/mwg_guidance.pdf#page=45

RE: IPTC tags in Photoshop File Info - Added by Robin Mills over 6 years ago

Alan is offering very good advice here.

The Exiv2 library (and command-line tools) give development engineers tools to read and write the metadata. The meaning of the data is the other side of the coin. The MetaData Working Group deals with that side of the coin.

We had a discussion last year about: Exif.Image.Description and how different applications store user "Titles" in the metadata.
http://dev.exiv2.org/issues/985

My conclusions were:
  1. Adobe applications are consistent (Bridge/PhotosShop/Lightroom use the same tags for the similar UI elements)
  2. Adobe, Google (Picasa) and Apple (iPhoto) do use different tags for "title"
  3. No application updates Exif.Image.ImageDescription for the image "title"

However, in your case, it sounds to me as though your Photographer is a PhotoShop/Adobe customer. So the recipe is:

  1. Find out which Metadata fields are being used in the workflow.
  2. Find out how the UI maps to metadata (by running exiv2 -pa filename)
  3. Write your script to read/write the appropriate tags

RE: IPTC tags in Photoshop File Info - Added by Scott Renton over 6 years ago

Thanks everyone. I think we're pointing in the right direction now.

Cheers
Scott

    (1-11/11)