[Originally posted by pauljsolomon on 2008-03-17 22:56:25-07]
I would like to be able to add the lens (EXIF) setting as a keyword. Also, I believe I would need to remove the spaces (e.g. EF 16-35mm f/2.8 USM").
It would be something like exiftool -keywords+='$Lens', but I believe this inserts the literal "$Lens" as a keyword.
Is there anyway to do this? My workaround is to use the "if" and test each lens then hardcode it into my script. Not optimal...
-paul.
[Originally posted by exiftool on 2008-03-18 01:31:40-07]
hi paul, you can use user-defined tags to modify
the lens string value before writing it to the
keywords.
[Originally posted by morganglines on 2008-04-08 01:31:15-07]I've had no problems using
exiftool -overwrite_original '-LensType+>keywords' -ext mie .
to do what's described above, but in the case of my 20mm Sigma Exiftool identifies it as either that or a 14mm Canon (I wish!). So, I'm doing something similar with lens type and iso:
exiftool -v -overwrite_original -keywords+="Canon EF 50mm f/1.4 USM" -keywords+="lens:maker=Canon" -keywords+="lens:focal_min=50" -keywords+="lens:focal_max=50" -if '$MaxAperture eq "1.4"' -if '$FocalLength eq "50.0mm"' -v -ext mie . -execute -overwrite_original -keywords+="Sigma 20mm EX f/1.8" -keywords+="lens:maker=Sigma" -keywords+="lens:focal_min=20" -keywords+="lens:focal_max=20" -if '$MaxAperture eq "1.8"' -if '$FocalLength eq "20.0mm"' -q -ext mie . -execute -overwrite_original -keywords+="Plastic Wonder" -keywords+="Canon EF 50mm f/1.8 MkII" -keywords+="lens:maker=Canon" -keywords+="lens:focal_min=50" -keywords+="lens:focal_max=50" -if '$MaxAperture eq "1.8"' -if '$FocalLength eq "50.0mm"' -q -ext mie . -execute -overwrite_original -keywords+="Canon EF 100mm f2.8 Macro USM" -keywords+="macro" -keywords+="close up" -keywords+="lens:maker=Canon" -keywords+="lens:focal_min=100" -keywords+="lens:focal_max=100" -if '$MaxAperture eq "2.8"' -if '$FocalLength eq "100.0mm"' -q -ext mie . -execute -overwrite_original -keywords+="Canon EF 135mm f/2L" -keywords+="Canon EF 135mm f/2L+1.4xTC" -keywords+="1.4xTC" -keywords+="lens:maker=Canon" -keywords+="lens:focal_min=135" -keywords+="lens:focal_max=135" -if '$MaxAperture eq "2.0"' -if '$FocalLength eq "189.0mm"' -if '$ShortFocal eq "135mm"' -if '$LongFocal eq "135mm"' -q -ext mie . -execute -overwrite_original -keywords+="Canon EF 135mm f/2L" -keywords+="lens:maker=Canon" -keywords+="lens:focal_min=135" -keywords+="lens:focal_max=135" -if '$MaxAperture eq "2.0"' -if '$FocalLength eq "135.0mm"' -q -ext mie . -execute -overwrite_original -keywords+="Canon EF 100-400mm f/4.5-5.6L IS" -keywords+="Canon EF 100-400mm f/4.5-5.6L IS+1.4xTC" -keywords+="1.4xTC" -keywords+="lens:maker=Canon" -keywords+="lens:focal_min=140" -keywords+="lens:focal_max=560" -if '$MaxAperture eq "8"' -if '$ShortFocal eq "140mm"' -if '$LongFocal eq "560mm"' -q -ext mie . -execute -overwrite_original -keywords+="Canon EF 100-400mm f/4.5-5.6L IS" -keywords+="lens:maker=Canon" -keywords+="lens:focal_min=100" -keywords+="lens:focal_max=400" -if '$MaxAperture eq "4.5"' -if '$FocalLength eq "135.0mm"' -q -ext mie . -execute -overwrite_original -keywords+="Canon EF 35mm f/2" -keywords+="lens:maker=Canon" -keywords+="lens:focal_min=35" -keywords+="lens:focal_max=35" -if '$MaxAperture eq "2.0"' -if '$FocalLength eq "35.0mm"' -q -ext mie . -execute -overwrite_original -FNumber="11.0" -FocalLength="16.0mm" -keywords+="16mm MC Zenitar Fisheye Lens" -keywords+="Fisheye" -keywords+="lens:maker=Zenitar" -keywords+="lens:focal_min=16" -keywords+="lens:focal_max=16" -if '$FocalLength eq "0.0mm"' -q -ext mie . -execute -overwrite_original -keywords+="Canon Macro Ring Lite MR-14EX" -if '$MaxAperture eq "2.8"' -if '$FocalLength eq "100.0mm"' -if '$Flash eq "On"' -if '$CanonFlashMode eq "External flash"' -q -ext mie . -execute -overwrite_original -keywords+="Canon EF 28-135mm f/3.5-5.6 IS" -keywords+="lens:maker=Canon" -keywords+="lens:focal_min=28" -keywords+="lens:focal_max=135" -if '$MaxAperture eq "3.5"' -if '$ShortFocal eq "28.0mm"' -if '$LongFocal eq "135.0mm"' -v -ext mie .
Exiftool redirects the values into keywords beautifully, but I've not figured out how to include the name of the tag along with the value. I also see a lot of validity to the argument that tags already present in the images shouldn't necessarily be written out as keywords. (I backup my metadata first to mie files, geotag to xmp, copy the xmp into the mie files to get the geodata, then modify the mie files with lens tags and other details before restoring back to processed JPEGs)
Anyone know if there's repository of scripts featuring exiftool? It's so amazingly flexible I'd imagine people must have come up with some neat ones.
[Originally posted by morganglines on 2008-04-08 01:34:13-07]I've had no problems using
exiftool -overwrite_original '-LensType+>keywords' -ext mie .
to do what's described above, but in the case of my 20mm Sigma Exiftool identifies it as either that or a 14mm Canon (I wish!). So, I'm doing something similar with lens type and iso:
exiftool -v -overwrite_original -keywords+="Canon EF 50mm f/1.4 USM" -keywords+="lens:maker=Canon" -keywords+="lens:focal_min=50" -keywords+="lens:focal_max=50" -if '$MaxAperture eq "1.4"' -if '$FocalLength eq "50.0mm"' -v -ext mie . -execute -overwrite_original -keywords+="Sigma 20mm EX f/1.8" -keywords+="lens:maker=Sigma" -keywords+="lens:focal_min=20" -keywords+="lens:focal_max=20" -if '$MaxAperture eq "1.8"' -if '$FocalLength eq "20.0mm"' -q -ext mie . -execute -overwrite_original -keywords+="Plastic Wonder" -keywords+="Canon EF 50mm f/1.8 MkII" -keywords+="lens:maker=Canon" -keywords+="lens:focal_min=50" -keywords+="lens:focal_max=50" -if '$MaxAperture eq "1.8"' -if '$FocalLength eq "50.0mm"' -q -ext mie . -execute -overwrite_original -keywords+="Canon EF 100mm f2.8 Macro USM" -keywords+="macro" -keywords+="close up" -keywords+="lens:maker=Canon" -keywords+="lens:focal_min=100" -keywords+="lens:focal_max=100" -if '$MaxAperture eq "2.8"' -if '$FocalLength eq "100.0mm"' -q -ext mie . -execute -overwrite_original -keywords+="Canon EF 135mm f/2L" -keywords+="Canon EF 135mm f/2L+1.4xTC" -keywords+="1.4xTC" -keywords+="lens:maker=Canon" -keywords+="lens:focal_min=135" -keywords+="lens:focal_max=135" -if '$MaxAperture eq "2.0"' -if '$FocalLength eq "189.0mm"' -if '$ShortFocal eq "135mm"' -if '$LongFocal eq "135mm"' -q -ext mie . -execute -overwrite_original -keywords+="Canon EF 135mm f/2L" -keywords+="lens:maker=Canon" -keywords+="lens:focal_min=135" -keywords+="lens:focal_max=135" -if '$MaxAperture eq "2.0"' -if '$FocalLength eq "135.0mm"' -q -ext mie . -execute -overwrite_original -keywords+="Canon EF 100-400mm f/4.5-5.6L IS" -keywords+="Canon EF 100-400mm f/4.5-5.6L IS+1.4xTC" -keywords+="1.4xTC" -keywords+="lens:maker=Canon" -keywords+="lens:focal_min=140" -keywords+="lens:focal_max=560" -if '$MaxAperture eq "8"' -if '$ShortFocal eq "140mm"' -if '$LongFocal eq "560mm"' -q -ext mie . -execute -overwrite_original -keywords+="Canon EF 100-400mm f/4.5-5.6L IS" -keywords+="lens:maker=Canon" -keywords+="lens:focal_min=100" -keywords+="lens:focal_max=400" -if '$MaxAperture eq "4.5"' -if '$FocalLength eq "135.0mm"' -q -ext mie . -execute -overwrite_original -keywords+="Canon EF 35mm f/2" -keywords+="lens:maker=Canon" -keywords+="lens:focal_min=35" -keywords+="lens:focal_max=35" -if '$MaxAperture eq "2.0"' -if '$FocalLength eq "35.0mm"' -q -ext mie . -execute -overwrite_original -FNumber="11.0" -FocalLength="16.0mm" -keywords+="16mm MC Zenitar Fisheye Lens" -keywords+="Fisheye" -keywords+="lens:maker=Zenitar" -keywords+="lens:focal_min=16" -keywords+="lens:focal_max=16" -if '$FocalLength eq "0.0mm"' -q -ext mie . -execute -overwrite_original -keywords+="Canon Macro Ring Lite MR-14EX" -if '$MaxAperture eq "2.8"' -if '$FocalLength eq "100.0mm"' -if '$Flash eq "On"' -if '$CanonFlashMode eq "External flash"' -q -ext mie . -execute -overwrite_original -keywords+="Canon EF 28-135mm f/3.5-5.6 IS" -keywords+="lens:maker=Canon" -keywords+="lens:focal_min=28" -keywords+="lens:focal_max=135" -if '$MaxAperture eq "3.5"' -if '$ShortFocal eq "28.0mm"' -if '$LongFocal eq "135.0mm"' -v -ext mie .
Exiftool redirects the values into keywords beautifully, but I've not figured out how to include the name of the tag along with the value. I also see a lot of validity to the argument that tags already present in the images shouldn't necessarily be written out as keywords. (I backup my metadata first to mie files, geotag to xmp, copy the xmp into the mie files to get the geodata, then modify the mie files with lens tags and other details before restoring back to processed JPEGs)
Anyone know if there's repository of scripts featuring exiftool? It's so amazingly flexible I'd imagine people must have come up with some neat ones.
[Originally posted by exiftool on 2008-04-08 11:22:21-07]As you have noticed the 3rd party lenses such as those by Sigma
often use the same LensType number as an OEM lens. This makes
identification more difficult and you have to get into guessing
the lens model from other meta information as you are doing by
checking the focal length.
To include the name of the tag along with the value, you would
do something like this:
exiftool '-keywords+<lens=$lens' FILE
This will add a keyword like "lens=75.0 - 300.0 mm" to FILE. Note
that the single quotes are used in most Unix shells (as apparently
you are using), while double quotes would be necessary in Windows.
Other than what people have posted in this forum, I don't keep a
library of scripts that people have written. However, if someone
publishes a script or utility that uses exiftool (and tells me about
it), I put a link in the "Related Utilities" section of the exiftool home
page.
- Phil