ExifTool Forum

General => Metadata => Topic started by: sergenious on March 24, 2025, 07:13:43 AM

Title: Canon MakerData focusing distance
Post by: sergenious on March 24, 2025, 07:13:43 AM
I am working on an Android application to browse photos in the way it should always be (that is, by physical directories, like on Windows, and not everything flat and sorted by date, like the stupid stock Android "Gallery" apps do):

- https://github.com/sergenious/MediaBrowserAndroid (https://github.com/sergenious/MediaBrowserAndroid)

This app displays as much EXIF values, as I thought was necessary and mostly the values that are contained in my photo files from several photo cameras, which I owned during my life: https://github.com/sergenious/MediaBrowserAndroid/blob/main/app/src/main/java/com/sergenious/mediabrowser/io/exif/ExifTag.java (https://github.com/sergenious/MediaBrowserAndroid/blob/main/app/src/main/java/com/sergenious/mediabrowser/io/exif/ExifTag.java)

However, I am struggling with Canon Maker notes. As it's proprietary format, no official specification exists. I understand that. The best source I found until now is this one:

- https://github.com/leapmotion/FreeImage/blob/master/Source/Metadata/TagLib.cpp#L239 (https://github.com/leapmotion/FreeImage/blob/master/Source/Metadata/TagLib.cpp#L239)

Here, I am most interested in FocusDistanceUpper and FocusDistanceLower. But when I read this structure of tag 4, I get back 34 short values, as is expected. But the values for FocusDistanceUpper and Lower at the offsets 19 and 20 are always 0.

How does your ExifTool know how to interpret these values? As it does display them correctly in meters.
Title: Re: Canon MakerData focusing distance
Post by: Phil Harvey on March 24, 2025, 07:45:32 AM
First, the page you reference is 10 years old, so newer cameras won't be represented.

Second, the FocusDistance tags are found in different locations for different models.  ExifTool currently extracts them from 21 different locations, but your reference lists only 1.

Here is the ExifTool code to extract Canon MakerNote information (https://raw.githubusercontent.com/exiftool/exiftool/refs/heads/master/lib/Image/ExifTool/Canon.pm).

The FocusDistance tags are stored as 16-bit unsigned integers in reverse byte order.  Divide by 100 to get meters.  A value of 65535 is infinity.

- Phil
Title: Re: Canon MakerData focusing distance
Post by: sergenious on March 25, 2025, 01:54:39 AM
Wow, thank you, you are amazing. Thanks, will check the code.

I only don't understand, how the EXIF standard was so shortsighted, to not expect such fields, and that camera manufacturers didn't unify by using some same custom EXIF tags, which would then later became a standard. Now the whole EXIF stuff is just one chaos :(

I also don't understand, why the maker data is such a closed secret, for the manufacturers to not reveal the specifications. What would they loose by publishing the specs?
Title: Re: Canon MakerData focusing distance
Post by: Phil Harvey on March 25, 2025, 06:45:06 AM
I have said repeatedly that the people responsible for the EXIF specification are brain dead.

- Phil