Unwanted numerical conversion

Started by yarda, February 23, 2016, 01:16:25 PM

Previous topic - Next topic

yarda

Experienced in 9.12 as well as in 10.10 on a Linux machine.

I have a simple/silly photo description "13/09" - refering to March/13.

$exiftool -description 20150913.01.jpg
Description                     : 13/09

When I store that in an XML file, all is fine:

$exiftool -description 20150913.01.jpg -X > 20150913.01.jpg.xml

---
<?xml version='1.0' encoding='UTF-8'?>
<rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'>

<rdf:Description rdf:about='20150913.01.FOOD.jpg'
  xmlns:et='http://ns.exiftool.ca/1.0/' et:toolkit='Image::ExifTool 9.12'
  xmlns:XMP-dc='http://ns.exiftool.ca/XMP/XMP-dc/1.0/'>
<XMP-dc:Description>13/09</XMP-dc:Description>
</rdf:Description>
</rdf:RDF>
---

However, when I try to read the description from the stored xml file, a numerical conversion is performed during reading...

$exiftool -description 20150913.01.jpg.xml
Description                     : 1.44444444444444

What am I overlooking?

Phil Harvey

There are some automatic conversions that are done for XML values that look like rational or date/time strings.  You may use this option to disable this feature: -api xmpautoconv=0

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

yarda

Alrighty, works with 10.10, not in 9.12 if anyone was curious (and for the record). Thank you, I am happy.

Phil Harvey

Right.  The XMPAutoConv API option was added in 8.78 (Feb 2012), but the -api command-line option was added in version 9.40 (Nov 2013).  So for versions from 8.78 to 9.39 you need to set the XMPAutoConv option in the config file to control this feature.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).