I'm looking to scrape the EXIF of all the photos I've taken using quite a variety of cameras. The thing is that not all cameras use the same fields.
So I'm thinking of using a query such as
exiftool -r -directory -filename -createdate -FileModifyDate -ISO -shutterspeed -fnumber -focallength -exposureprogram -model /path/to/photos/
and modify it on a per model basis.
So does a switch such as IfTAG <tag>= modelX exist?
Or is there a better way of doing this?
Thanks!
The -if option can be used to test the value of any tag:
exiftool -if "$model eq 'some model'" ...
Is this what you want? (Swap the single/double quotes if you are on Mac or Linux.)
- Phil
That works great thanks! Just need to remember that on OSX the camera model text is case sensitive
Yes. On all systems this is true. Often a regular expression is easier:
exiftool -if '$model =~ /some model/i' ...
Here "some model" will match anywhere in the Model string, and the "i" makes it case-insensitive.
- Phil
The regex idea is useful.
Does the IF statement take a Boolean eg ' "NIkon D300" OR "Nikon D600" '?
Yes, operators "and" "or", etc all work. You would do this:
-if '$model eq "NIKON D300" or $model eq "NIKON D600"'
- Phil