ExifTool Forum

ExifTool => Newbies => Topic started by: BobV on December 04, 2012, 07:52:16 AM

Title: Is there a way to truncate Lens andFocalLength output such that 50.0 becomes 50?
Post by: BobV on December 04, 2012, 07:52:16 AM
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
Title: Re: Is there a way to truncate Lens andFocalLength output such that 50.0 becomes 50?
Post by: Phil Harvey on December 04, 2012, 07:58:39 AM
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