ExifTool Forum

General => Metadata => Topic started by: mixx on April 19, 2010, 12:57:43 AM

Title: FocalLengthIn35mmFormat vs FocalLength35efl
Post by: mixx on April 19, 2010, 12:57:43 AM
I can not believe this: I just bought a $200 FUJI camera for a family member and it does not set the focal length value in 35mm terms! I thought these days every camera does that. Yikes.

Anyway, as I was studying the EXIF data I noticed that this information is in there somehow.

What I have:


[ExifIFD] FocalLength: 5.0mm
[Composite] FocalLength35efl: 5.0mm (35mm equivalent: 29.0mm)


Now, how is that FocalLength35efl computed? Is it computed for all cameras?

With some string processing I could get out the required numbers and put them into FocalLengthIn35mmFormat. That way, one does not have to remember the conversion factors for the various sensors.

Thanks for any info, Mixx
Title: Re: FocalLengthIn35mmFormat vs FocalLength35efl
Post by: Phil Harvey on April 19, 2010, 07:32:50 AM
Hi Mixx,

The computation is based on the FocalPlaneX/YResolution tags unless the FocalLengthIn35mmFormat tag exists already in which case it is used.  See the Composite tag name documentation (https://exiftool.org/TagNames/Composite.html) for a list of tags used in the calculation.  (Also look up the tags used in calculating ScaleFactor35efl.   Note that some of these are used only if others are not available.)

You don't need to do any fancy string processing to copy the computed value to the standard tag:

exiftool "-focallengthin35mmformat<focallength35efl" -n DIR

This command will set this tag for all images in a directory.  The -n option is used to get the numerical value of a tag.

- Phil

Title: Re: FocalLengthIn35mmFormat vs FocalLength35efl
Post by: mixx on April 20, 2010, 12:55:23 PM
Waaay cool, again!  :)

No I can ditch all my scripts for the various small cameras with different 35mm factors and just have one universal script.

Can I assume that FocalLength35efl is *always* computed and always correctly (I mean do all manufacturers provide the information you use to compute it)?

Thanxx, Mixx
Title: Re: FocalLengthIn35mmFormat vs FocalLength35efl
Post by: Phil Harvey on April 21, 2010, 07:53:04 AM
The Composite::FocalLength35efl is calculated only if the necessary tags exist in the image.  As stated in the documentation, this value may not be correct if the image has been resized by some software.  For images straight out of the camera, it should be reliable.

- Phil