Author Topic: Turning off rationals  (Read 1949 times)

adamlelean

  • Newbie
  • *
  • Posts: 1
Turning off rationals
« on: February 10, 2012, 09:10:37 AM »
I think I want some way to turn off the conversion of a string containing "/" into a floating point number, but since I'm new to exiftool I'll explain what I'm seeing.

I have a pdf, generated by a thirdparty.
Using
Code: [Select]
exiftool -G1 -S -PrimaryMaterialsID test.pdfreturns
[XMP-adsml-at] PrimaryMaterialsID: 131282.454545455

but if I dump the metadata using the -b flag the appropriate line looks like:
<adsml-at:PrimaryMaterialsID>1444107/11</adsml-at:PrimaryMaterialsID>

What I think is happening, is exiftool, because it doesn't recognise the field, is using various guesses on what to do with the string.

Is there some way to turn this off, other than writing new rules in ExifTool_config

In the documentation it talked about processing rationals , but I assumed that would only be on input.

In general I actually want to use the perl Image::ExifTool module, but for experimentation have been playing with the command line exiftool

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 16878
    • ExifTool Home Page
Re: Turning off rationals
« Reply #1 on: February 10, 2012, 09:31:32 AM »
Currently there is no option to disable the automatic conversion for unknown XMP values.

As you mentioned, this conversion may be defeated by a user-defined tag with Writable => 'string'.  If you are using the API, this may be done in your script without the need for a config file.

Similarly, there is a date conversion that is applied to unknown XMP tags with date/time-looking values.

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

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 16878
    • ExifTool Home Page
Re: Turning off rationals
« Reply #2 on: February 10, 2012, 09:53:35 AM »
I thought about this, and can see how this could be very inconvenient.

So in version 8.78 I will add a "XMPAutoConv" option that may be disabled through the config file or the API.

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