FocalLengthIn35mmFormat vs FocalLength35efl

Started by mixx, April 19, 2010, 12:57:43 AM

Previous topic - Next topic

mixx

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

Phil Harvey

#1
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 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

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

mixx

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

Phil Harvey

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