ApproximateFocusDistance is not used for computing the DOF tag

Started by mikio, October 05, 2018, 03:15:11 AM

Previous topic - Next topic

mikio

Hi,
I noticed that ApproximateFocusDistance was not used for computing DOF.
Checking the source code Exif.pm, I locate the bug.

    DOF => {
        Description => 'Depth Of Field',
        Notes => 'this value may be incorrect if the image has been resized',
        Require => {
            0 => 'FocalLength',
            1 => 'Aperture',
            2 => 'CircleOfConfusion',
        },
        Desire => {
            3 => 'FocusDistance',   # focus distance in metres (0 is infinity)
            4 => 'SubjectDistance',
            5 => 'ObjectDistance',
            6 => 'ApproximateFocusDistance ',
            7 => 'FocusDistanceLower',
            8 => 'FocusDistanceUpper',
        },
        ValueConv => q{


There, a whitespace is trailing ApproximateFocusDistance. When I removed it, it worked.
The version I checked was the current latest (11.12).
Thanks for the great tool, anyway.

Phil Harvey

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