Is there a way to truncate Lens andFocalLength output such that 50.0 becomes 50?

Started by BobV, December 04, 2012, 07:52:16 AM

Previous topic - Next topic

BobV

I'm using exiftool from the command line, and everything is working well. I have only one minor issue: Currently, it reports things like 24.0-120.0 mm f/4.0 for the $Lens, which is correct as this is a Nikkor AF-S 24-120. However, I don't like the decimal. Is there a way to get the output to be the following? 24-120 mm f/4.0

Same for $FocalLength: I get 24.0 mm but would like 24 mm

Phil Harvey

Which Lens tag is this?  There are lots.  (use "exiftool -a -G1 -lens FILE")  The Nikon:Lens tag should not have the decimal point.  If it is XMP:Lens, then this is stored as a string, and ExifTool is only reporting what was written by another application.  But any tag can be reformatted through a user-defined Composite tag if you want.

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