Changing data dependend on other tags

Started by Beholder3, March 26, 2014, 04:39:40 PM

Previous topic - Next topic

Beholder3

Hi,

I want to achieve a change to both the exif:LensModel and the XMP:Lens tags based on the LensID and FocalLength on a windows system.
I own a Pentax DA*300mm lens and the new x1,4 TC. Currently the metadata doesnt really reflect the use of the TC (other than indirectly by Focal length and FNumber.

Basically I want to detect the combination of LensID=8/234 and FocalLength=420mm and then write  exif:LensModel="smc PENTAX-DA* 300mm F4 ED [IF] SDM + HD Pentax-DA AF-Konverter 1,4x AW" and XMP:Lens="smc PENTAX-DA* 300mm F4 ED [IF] SDM + HD Pentax-DA AF-Konverter 1,4x AW".

I think there is no other way to detect the use of the TC in the metadata.

StarGeek

You'll have to check your image for the exact LensID and FocalLength you want to match but it would be something like this (example for Windows, exchange single and double quotes on mac/linux):

ExifTool -if "$LensID=8/234 and $FocalLength=420mm" -exif:LensModel="smc PENTAX-DA* 300mm F4 ED [IF] SDM + HD Pentax-DA AF-Konverter 1,4x AW"  -XMP:Lens="smc PENTAX-DA* 300mm F4 ED [IF] SDM + HD Pentax-DA AF-Konverter 1,4x AW" <FILE/DIR>

* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

Phil Harvey

StarGeek has the right idea, but I think the condition may look more like this:

-if "$lenstype# eq '8 234' and $focallength# == 420"

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

StarGeek

Yes, yes, my big mistake.  I look at that and I don't know what I was thinking. 
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).