ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: Jon on November 10, 2010, 06:11:40 PM

Title: Changing ApertureValue tag to match UserComment tag
Post by: Jon on November 10, 2010, 06:11:40 PM
Hi Phil, I came across ExifTool when I was looking for a way to add exif data to an old non-CPU lens I use on my D90.  So far I've been able to add most of the data I need - focal length, lens name, that kind of stuff - but the one thing I'm still having trouble with is the ApertureValue tag.  When I shoot with this lens, I add a user comment with the aperture value so I can remember what the aperture was.  What I'd like to do in ExifTool is change the ApertureValue tag to match the UserComment tag.  I tried the following but I must be missing something:

exiftool -overwrite_original -ApertureValue='11' -if -UserComment='11'

I hunted around of the forums and found a few similar threads but I'm afraid my perl knowledge is not advanced enough to apply what I saw to this issue.

Also, if that's doable, would it be possible to run one command for a folder with files with different UserComment tags?  So I could do something like

-ApertureValue='2.8' -if -UserComment='2.8' -ApertureValue='4' -if -UserComment='4' -ApertureValue='5.6' -if -UserComment='5.6'  . . . and so on.

Thanks - and thanks for putting ExifTool out there.  I know I've only scratched the surface but it seems like an amazing tool.

Jon
Title: Re: Changing ApertureValue tag to match UserComment tag
Post by: Phil Harvey on November 10, 2010, 06:53:28 PM
Hi Jon,

It looks like you can simply copy your comment directly to ApertureValue tag:

exiftool "-apertureValue<comment" FILE

And of course, you can do a whole directory at once if FILE is a directory name.

BTW, for the record, the correct -if option syntax would be: -if '$aperturevalue==4'.

- Phil
Title: Re: Changing ApertureValue tag to match UserComment tag
Post by: Jon on November 11, 2010, 09:36:39 AM
Fantastic - thanks for the amazingly quick reply.  I'll try both of those options out but I agree that the first one is the more elegant solution.

Thanks again, Jon