ExifTool Forum

ExifTool => Newbies => Topic started by: kgarrett on October 29, 2015, 10:06:29 AM

Title: Problem writing XMP Dublin Core fields
Post by: kgarrett on October 29, 2015, 10:06:29 AM
I can't break this nut. I'm running exiftool via Applescript via Filemaker. Everything is working fine except that now it is not writing the XMP Dublin Core data -- specifically Title, Description, and Creator. All other fields are written just fine.

Below is the latest attempt at figuring out how to do it. This is the assembled output to the command line. I get no errors:

/usr/local/bin/exiftool -o '/Users/kevingarrett/Desktop/Output/SNST-1001/SNST-1001-08.jpg' -xmp-dc:Creator="Diecast Select" -xmp-dc:description="Diecast car model of a 1963 Aston Martin DB5. This Sun Star 1/18 scale model has a diecast metal body, features a detailed engine & engine compartment, trunk & interior and has opening doors, hood & trunk. Working steering. Finished in British Racing Green paint. The model is approximately 9 inches long." -xmp-dc:title="Aston Martin DB5, 1963, British Racing Green" -CopyrightNotice="Copyright 2015, Diecast Select & PM Online Sales, Inc." -CreatorCity="Valencia" -CreatorCountry="USA" -CreatorAddress="24307 Magic Mtn Pkwy #286" -CreatorPostalCode="91355" -CreatorRegion="California"  -CreatorWorkEmail="sales@diecastselect.com" '/Users/kevingarrett/Dropbox/DCS/Product Database/Images/Image 08/SNST-1001-08.jpg'

I've tried variations of how to address the XMP dc fields (e.g. "-XMP-dc:title=") but nothing has worked so far. I started with "-Title=" and I could swear that was working originally. I don't know what happened. I always get empty Dublin Core fields in the image:


<dc:creator>
   <rdf:Seq/>
</dc:creator>
<dc:description>
   <rdf:Alt/>
</dc:description>
<dc:title>
   <rdf:Alt/>
</dc:title>

Any help would be appreciated.

Thank you.

Kevin Garrett
Title: Re: Problem writing XMP Dublin Core fields
Post by: Phil Harvey on October 29, 2015, 10:10:47 AM
Hi Kevin,

I tried your options on a test file here and got this:

> exiftool a.jpg -all=
    1 image files updated
> exiftool a.jpg -xmp-dc:Creator="Diecast Select" -xmp-dc:description="Diecast car model of a 1963 Aston Martin DB5. This Sun Star 1/18 scale model has a diecast metal body, features a detailed engine & engine compartment, trunk & interior and has opening doors, hood & trunk. Working steering. Finished in British Racing Green paint. The model is approximately 9 inches long." -xmp-dc:title="Aston Martin DB5, 1963, British Racing Green" -CopyrightNotice="Copyright 2015, Diecast Select & PM Online Sales, Inc." -CreatorCity="Valencia" -CreatorCountry="USA" -CreatorAddress="24307 Magic Mtn Pkwy #286" -CreatorPostalCode="91355" -CreatorRegion="California" -CreatorWorkEmail="sales@diecastselect.com"
    1 image files updated
> exiftool a.jpg -a -G1 -xmp:all
[XMP-x]         XMP Toolkit                     : Image::ExifTool 10.05
[XMP-iptcCore]  Creator City                    : Valencia
[XMP-iptcCore]  Creator Country                 : USA
[XMP-iptcCore]  Creator Address                 : 24307 Magic Mtn Pkwy #286
[XMP-iptcCore]  Creator Postal Code             : 91355
[XMP-iptcCore]  Creator Region                  : California
[XMP-iptcCore]  Creator Work Email              : sales@diecastselect.com
[XMP-dc]        Creator                         : Diecast Select
[XMP-dc]        Description                     : Diecast car model of a 1963 Aston Martin DB5. This Sun Star 1/18 scale model has a diecast metal body, features a detailed engine & engine compartment, trunk & interior and has opening doors, hood & trunk. Working steering. Finished in British Racing Green paint. The model is approximately 9 inches long.
[XMP-dc]        Title                           : Aston Martin DB5, 1963, British Racing Green


In this test, Title, Description and Creator are written fine.  If it doesn't work for your JPG file, please send it to me and I'll take a look (I'm thinking there may be a problem with the existing XMP).  My email is philharvey66 at gmail.com

- Phil
Title: Re: Problem writing XMP Dublin Core fields
Post by: kgarrett on October 29, 2015, 12:11:55 PM
Wow. Thanks for your speedy reply.

OK, that surprised me. Your positive result got me to try another record from my database and the output was perfect. Then I tried another record, with only partially successful results. Then another (file KYOS-08033C-01.jpg) with zero fields written. So I ran exiftool -all= KYOS-08033C-01.jpg to delete the metadata and checked the output of exiftool KYOS-08033C-01.jpg  -a -G1 -xmp:all with the desired blank results. I then ran my script again and checked the output file and got:

[XMP-x]         XMP Toolkit                     : Image::ExifTool 10.03
[XMP-iptcCore]  Creator City                    : Valencia
[XMP-iptcCore]  Creator Country                 : USA
[XMP-iptcCore]  Creator Address                 : 24307 Magic Mtn Pkwy #286
[XMP-iptcCore]  Creator Postal Code             : 91355
[XMP-iptcCore]  Creator Region                  : California
[XMP-iptcCore]  Creator Work Email              : sales@diecastselect.com
[XMP-dc]        Creator                         : Diecast Select
[XMP-dc]        Description                     : Diecast car model of the Triumph TR3A driven by Ninian Sanderson and Claude Dubois in the 1959 24 Hours of Le Mans. This 1/18 scale model from Kyosho has a diecast metal body with opening doors, hood & trunk, and features a detailed engine & engine compartment, trunk & interior. Working steering. The paint color is British Racing Green with Red Nose. The model is approximately 8 inches long.
[XMP-dc]        Title                           : Triumph TR3A, Le Mans 1959, #27 Sanderson / Dubois


So your assumptioni was correct. Something was fubarred in the original image file. I think the plan would be to wipe all the metadata from the images referenced in the database. Since I have your attention, would you mind pointing me to the correct command to remove the XMP data from all images in a directory?

Thank you so much for your help and for writing this great tool.

Kevin Garrett


Title: Re: Problem writing XMP Dublin Core fields
Post by: Phil Harvey on October 29, 2015, 12:13:59 PM
Hi Kevin,

Could you please send me a problem file to test? (Or at least the original XMP from a problem file?) It would be nice if ExifTool would issue a warning if possible.

The way to wipe all XMP from a directory is exiftool -xmp:all= DIR

- Phil
Title: Re: Problem writing XMP Dublin Core fields
Post by: kgarrett on October 29, 2015, 12:48:26 PM
The files are on their way.

Thanks.
Title: Re: Problem writing XMP Dublin Core fields
Post by: Phil Harvey on October 29, 2015, 12:56:00 PM
I got the files, thanks.  But I can't reproduce the problem:

> cp ~/Desktop/KYOS-08033C-02.jpg a.jpg
> exiftool a.jpg -a -G1 -xmp-dc:all
[XMP-dc]        Format                          : image/jpeg
> exiftool a.jpg -xmp-dc:Creator="Diecast Select" -xmp-dc:description="Diecast car model of a 1963 Aston Martin DB5. This Sun Star 1/18 scale model has a diecast metal body, features a detailed engine & engine compartment, trunk & interior and has opening doors, hood & trunk. Working steering. Finished in British Racing Green paint. The model is approximately 9 inches long." -xmp-dc:title="Aston Martin DB5, 1963, British Racing Green" -CopyrightNotice="Copyright 2015, Diecast Select & PM Online Sales, Inc." -CreatorCity="Valencia" -CreatorCountry="USA" -CreatorAddress="24307 Magic Mtn Pkwy #286" -CreatorPostalCode="91355" -CreatorRegion="California" -CreatorWorkEmail="sales@diecastselect.com"
    1 image files updated
> exiftool a.jpg -a -G1 -xmp-dc:all
[XMP-dc]        Creator                         : Diecast Select
[XMP-dc]        Description                     : Diecast car model of a 1963 Aston Martin DB5. This Sun Star 1/18 scale model has a diecast metal body, features a detailed engine & engine compartment, trunk & interior and has opening doors, hood & trunk. Working steering. Finished in British Racing Green paint. The model is approximately 9 inches long.
[XMP-dc]        Format                          : image/jpeg
[XMP-dc]        Title                           : Aston Martin DB5, 1963, British Racing Green


- Phil
Title: Re: Problem writing XMP Dublin Core fields
Post by: kgarrett on October 29, 2015, 02:13:33 PM
Hrm... I'll find another and send it to you. Thanks.

Kevin
Title: Re: Problem writing XMP Dublin Core fields
Post by: kgarrett on October 30, 2015, 12:30:56 PM
I discovered that the problem is with ampersands in the description. Exiftool will write and read the description alright with unescaped ampersands, but the tools I used to check the metadata -- Photoshop being the standard for me -- won't recognize any of the Dublin Core fields if there are any unescaped ampersands. I fixed that and now I can reliably write the data.
Title: Re: Problem writing XMP Dublin Core fields
Post by: Phil Harvey on October 30, 2015, 12:39:48 PM
Can you provide more details?  Ampersands should be properly escaped when written by ExifTool, and you shouldn't have problems reading this with Photoshop:

> exiftool -title="test & stuff" -o -.xmp
<?xpacket begin='' id='W5M0MpCehiHzreSzNTczkc9d'?>
<x:xmpmeta xmlns:x='adobe:ns:meta/' x:xmptk='Image::ExifTool 10.04'>
<rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'>

<rdf:Description rdf:about=''
  xmlns:dc='http://purl.org/dc/elements/1.1/'>
  <dc:title>
   <rdf:Alt>
    <rdf:li xml:lang='x-default'>test &amp; stuff</rdf:li>
   </rdf:Alt>
  </dc:title>
</rdf:Description>
</rdf:RDF>
</x:xmpmeta>
<?xpacket end='w'?>


(Here I have used -o -.xmp to send the output XMP file to the console so you can see the escaped ampersand.)

- Phil