Thread

Posted on Sat Apr 12 21:31:41 2008 by mixx
Conditional processing (-if) question
Good evening,

I am ashamed but need to ask this question, as for the life of me I can not figure out what I am doing wrong. I'd like to go through all my files and fix up old images to put in there the FocalLengthin35mmFormat. I wrote a new tag in .exiftool_config that computes that value by multiplying FocalLength with the appropriate number. It is called Foc6. Now I want to do

exiftool "-Foc6>FovalLengthIn35mmFormat" -if '$model eq "DMC-FZ5"' test.jpg

This should work and it does on a single image without the -if part. It seems that the -if part does not match any image, even though I have thousands of them. I tried all other $models and also $makes and non of them matches. I also tried other operators such as "ne" they do not work either. It seems that I have an -if problem. I also tried running in a shell (and not DOS), that does not help either.

What can be wrong? I run the latest version as a Windows executable.

Thanks for any help, Mixx

Direct Responses: 7651 | Write a response
Posted on Sun Apr 13 01:48:15 2008 by exiftool in response to 7650
Re: Conditional processing (-if) question
Hi Mixx,

I'll assume you are using the right quotes for your shell, although all Windows shells I know would require the double quotes on the outside. ie. "$model eq 'DMC-FZ5'"

It is possible there are spaces after the model name, which would break the match for "eq". If this is the problem, searching for a substring instead will get things working for you. ie. "$model =~ /DMC-FZ5/"

- Phil
Direct Responses: 7652 | Write a response
Posted on Sun Apr 13 14:42:21 2008 by mixx in response to 7651
Re: Conditional processing (-if) question
Phil,

thanks so much, you are right on both counts: it was a mixture of white space and wrong quotes. I must admit, I never realized that quotes should go the opposite in Windows and Unix shells.

I'd think that a hint to that effect in the exiftool application documentation would be very useful for people like me (and I like to think there are a number of us :-)

Thanks again, mate!

Mixx

Write a response