EXIF:LensModel vs XMP:Lens

Started by busywait, January 13, 2017, 05:02:40 PM

Previous topic - Next topic

busywait

Hello,

I would like exiftool to treat Lens and LensModel as synonyms.

As an example, when I use
exiftool -LensModel="BigLens 500mm f/8" file.xmp
then I would like the aux:lens element in file.xmp to be updated with "BigLens 500mm f/8", instead of exiftool creating a new exif:LensModel element in file.xmp.

Is that possible?

Thanks for any help you can give :)

Alan Clifford

I don't understand why you are updating "lensmodel" when you don't want to and why you are not updating "lens" when you want to.

busywait

I have a single command line that updates (raw) .orf files and .xmp sidecar files at the same time. The raw file has LensModel usually, but I have some old lenses that don't pass EXIF data, so I write the LensModel attribute in using my exiftool command line.

If I have made any kind of change to the raw file in software like ACDSee then a .xmp sidecar will have been generated. These have a Lens element in. EXIF attributes like LensModel do not seem to be written by ACDsee at least, and I'm trying to stay consistent with that.

Lens and LensModel are synonyms to access the same data aren't they? (Or, the Lens and LensModel strings are always the same - ACDsee is just copying the string from LensModel string from my raw files and writing it as Lens in the .xmp files).


Phil Harvey

It sounds like you want to write both EXIF:LensModel and XMP:Lens, with the exception that you don't want to create XMP in a RAW file if it doesn't already exist.  (The EXIF:LensModel can't be written to XMP files, so this is OK.)  You prevent ExifTool from creating new XMP in a RAW file by adding the -wm wc to the command.

- 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 ($).

busywait

Quote from: Phil Harvey on January 13, 2017, 10:51:42 PM
It sounds like you want to write both EXIF:LensModel and XMP:Lens, with the exception that you don't want to create XMP in a RAW file if it doesn't already exist.

I want to write my lens model string in to the most appropriate field for the file format, and update it anywhere else that it happens to have been created - so if LensModel has somehow been written to a .xmp I'd like to update it, but Lens seems to be the name for the same data in .xmp files.

I prefer not to have the same data in more than one place because I'll probably accidentally find a way to end up with different values and not know which to trust. So, maybe I shouldn't ever create it in the .xmp, only update it. Opinions welcome :)

Quote from: Phil Harvey on January 13, 2017, 10:51:42 PM
(The EXIF:LensModel can't be written to XMP files, so this is OK.)


exiftool.exe -LensModel="X" "file.xmp"
    1 image files updated

does write ExifEx LensModel:

<rdf:Description rdf:about=''
  xmlns:exifEX='http://cipa.jp/exif/1.0/'>
  <exifEX:LensModel>X</exifEX:LensModel>
</rdf:Description>


That element was not in file.xmp before I ran the command, but it did have other exif data about the usual shooting parameters:

<rdf:Description rdf:about=''xmlns:exif='http://ns.adobe.com/exif/1.0/'>
  <exif:ColorSpace>1</exif:ColorSpace>
  <exif:Contrast>1</exif:Contrast>
  ...
</rdf:Description>


Adobe and ACDsee both copy various pieces of exif like that from raw to xmp when they create a .xmp sidecar file. If there is a LensModel already in the raw file they both move/copy that string the XMP aux:Lens.

Quote from: Phil Harvey on January 13, 2017, 10:51:42 PM
  You prevent ExifTool from creating new XMP in a RAW file by adding the -wm wc to the command.

Thanks - that looks like helpful magic. - I'm thinking that -wm w or -wm wc are going to be helpful.

Phil Harvey

Quote from: busywait on January 14, 2017, 06:13:52 AM
So, maybe I shouldn't ever create it in the .xmp, only update it.

Sounds reasonable.

You can do this with -wm w (as you mentioned)

Quote
Quote from: Phil Harvey on January 13, 2017, 10:51:42 PM
(The EXIF:LensModel can't be written to XMP files, so this is OK.)


exiftool.exe -LensModel="X" "file.xmp"
    1 image files updated

Yes.  You wrote "LensModel", which will write "EXIF:LensModel" and "XMP-exif:LensModel".  I was talking about writing "EXIF:LensModel" only.

- 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 ($).