Is distance to subjected recorded in exif?

Reza Raquib

Forum Enthusiast
Messages
455
Reaction score
223
Location
Ponte Vedra, FL, US
Using RF lens it shows the distance scale, but is it recorded somewhere? I could not find the information in DPP exif viewer.
 
Using RF lens it shows the distance scale, but is it recorded somewhere? I could not find the information in DPP exif viewer.
If you use Lightroom, you might find it in the XMP, that is if XMPs are written.

In Lightroom 6 it is written as a fraction

aux:LensInfo="100/1 400/1 0/0 0/0"
aux:Lens="EF100-400mm f/4.5-5.6L IS USM"
aux:LensID="183"
aux:ImageNumber="0"
aux:ApproximateFocusDistance="452/100"

In this instance it is I think, 4.52 meters.

aux:Lens="EF28-135mm f/3.5-5.6 IS USM"
aux:LensID="178"
aux:ImageNumber="0"
aux:ApproximateFocusDistance="157/10"
aux:FlashCompensation="0/1

I think, 15.7 meters
 
Using RF lens it shows the distance scale, but is it recorded somewhere? I could not find the information in DPP exif viewer.
Exiftool shows much more information. Some information present in the CR3 file is not present in a JPG file. Editing software may remove more exif data.

I hope this helps.

exiftool IMG_5158.CR3 | egrep -i dista

Focus Distance Upper : 555.79 m
Focus Distance Lower : 81.91 m
Hyperfocal Distance : 1157.95 m
 
Using RF lens it shows the distance scale, but is it recorded somewhere? I could not find the information in DPP exif viewer.
Exiftool shows much more information. Some information present in the CR3 file is not present in a JPG file. Editing software may remove more exif data.

I hope this helps.

exiftool IMG_5158.CR3 | egrep -i dista

Focus Distance Upper : 555.79 m
Focus Distance Lower : 81.91 m
Hyperfocal Distance : 1157.95 m
That is informative.

Does this apply to all lenses and cameras or just to the most modern?
 
Using RF lens it shows the distance scale, but is it recorded somewhere? I could not find the information in DPP exif viewer.
Exiftool shows much more information. Some information present in the CR3 file is not present in a JPG file. Editing software may remove more exif data.

I hope this helps.

exiftool IMG_5158.CR3 | egrep -i dista

Focus Distance Upper : 555.79 m
Focus Distance Lower : 81.91 m
Hyperfocal Distance : 1157.95 m
That is informative.

Does this apply to all lenses and cameras or just to the most modern?
Actually I am not sure that is telling us anything about the focussing distance in the image.

There is a field

"Approximate.focus distance",underlined in the text below

which is more informative as well as others also underlined below

I have converted my CR3 files to DNG as I use Lightroom 6.

ExifTool Version Number : 12.34
File Name : _MG_0427.dng
Directory : E:/Canon R5 DNG/2021/02_2021_October Nov December
File Size : 49 MiB

Snipped

Lens : EF100-400mm f/4.5-5.6L IS USM
Approximate Focus Distance : 3.8


Snipped

Circle Of Confusion : 0.030 mm
Depth Of Field : 0.04 m (3.81 - 3.85 m)
Field Of View : 5.2 deg


Focal Length : 400.0 mm (35 mm equivalent: 399.4 mm)
Hyperfocal Distance : 664.64 m
Light Value : 11.3
Lens ID : Canon EF 100-400mm f/4.5-5.6L IS USM
-- press ENTER --
 
Last edited:
Using RF lens it shows the distance scale, but is it recorded somewhere? I could not find the information in DPP exif viewer.
Short answer is no, Canon's out of camera JPEGs for recent models don't appear to have the 'sometimes used' "Subject Distance" Exif Tag (ID: 0x9206).

The longer answer for Canon files, is that there is some focus distance related data recorded in MakerNotes that you may be able to access depending on which software you use.

For example, Adobe software seem to read these and then add an Exif tag called "ApproximateFocusDistance". Better than nothing but I wouldn't rely on it for accuracy.

Example using ExifTool with DPR sample :

OOC JPEG (No approximate distance):

c39a63b8cdde41ea8d83d5c9f7bd71c9.jpg.png

Adobe version JPEG from raw:

cddde273b8d841a3919fd7fcb6f19e4c.jpg.png

Note how in this case saving the JPEG lost the MakerNotes. That's either because it was an early version of Adobe support for the R5 or because of Carey's settings. Checking the raw shows the MakerNotes were there:

51d0f0d7288e4530a33fd54d51433a2d.jpg.png

In most galleries these MakerNotes are preserved by Adobe:

8b8c0723996746dd8555d6e3156d3691.jpg.png

I'm not aware of how adobe make the guess between the upper and lower limits, it might be a formula, or perhaps there is additional MakerNote data about the AF system (like there is in µ43 files) that isn't widely known yet.
 
Using RF lens it shows the distance scale, but is it recorded somewhere? I could not find the information in DPP exif viewer.
Exiftool shows much more information. Some information present in the CR3 file is not present in a JPG file. Editing software may remove more exif data.

I hope this helps.

exiftool IMG_5158.CR3 | egrep -i dista

Focus Distance Upper : 555.79 m
Focus Distance Lower : 81.91 m
Hyperfocal Distance : 1157.95 m
That is informative.

Does this apply to all lenses and cameras or just to the most modern?
This is from a Canon file. If the lens has electronics and auto focus these values are there. For a manual only lens with no electronics, these distances do not have useful values. Which fields are present in exif data vary from camera to camera.

One might guess that the focus distance is about the lower distance for depth of field plus one third of the total "Depth of Field". That might be how Adobe software calculates "Approximate Focus Distance".

The circle of confusion value might be used to interpret the distance numbers. This assumes some arbitrary print size and some arbitrary viewing distance and some arbitrary eyesight ability and spacing of pixels on the sensor chip.

exiftool IMG_5204.CR3 | egrep -i "dista|circ|Depth of Field|view"
  • Focus Distance Upper : inf
  • Focus Distance Lower : 81.91 m
  • Circle Of Confusion : 0.030 mm
  • Depth Of Field : 226.38 m (287.42 - 513.80 m)
  • Field Of View : 3.7 deg
  • Hyperfocal Distance : 1302.69 m
------
John Moyer
 
Yes, I see it in at least some of my photos taken with the R6.

And sorry for the "self-promoting", but I have made an EXIF-viewer for Firefox which shows it: xIFr .

Some examples originals where distance information can be found with xIFr:

RF800 / 68.3m

EF70-300L / 99.5m

RF24-105L / 0.62m

RF800 / 5.72m

These are processed from RAW format. But I was shooting RAW+JPG on some of them, and I can also see the distance information in the original JPGs.

And yes, exif data in the last photo actually reports a shorter distance than the official minimum focusing distance of the lens. How precise it is I don't know, but I know the cat was close and I felt lucky being able to focus on it (and frame it) with the long lens attached :-)

--
/Stig (Copenhagen, Denmark)
https://www.rockland.dk/
https://flickr.com/photos/stignygaard/
Flickr Fixr: https://www.flickr.com/groups/flickrhacks/discuss/72157655601688753/
xIFr, the Firefox exif-viewer: https://addons.mozilla.org/firefox/addon/xifr/
 
Last edited:
These are processed from RAW format. But I was shooting RAW+JPG on some of them, and I can also see the distance information in the original JPGs.
The JPGs tested was actually not 100% untouched. I had used Adobe Bridge to add keywords. Seems Bridge in that process has does something to make the focus distance readable with xIFr.

I just tried an JPG straight out of camera (shot with the EF70-300L), and xIFr is unable to see the distance information. But it must be somewhere in there in proprietary Canon format maybe?
 
Using RF lens it shows the distance scale, but is it recorded somewhere? I could not find the information in DPP exif viewer.
Short answer is no, Canon's out of camera JPEGs for recent models don't appear to have the 'sometimes used' "Subject Distance" Exif Tag (ID: 0x9206).

The longer answer for Canon files, is that there is some focus distance related data recorded in MakerNotes that you may be able to access depending on which software you use.

For example, Adobe software seem to read these and then add an Exif tag called "ApproximateFocusDistance". Better than nothing but I wouldn't rely on it for accuracy.

Example using ExifTool with DPR sample :

OOC JPEG (No approximate distance):

c39a63b8cdde41ea8d83d5c9f7bd71c9.jpg.png

Adobe version JPEG from raw:

cddde273b8d841a3919fd7fcb6f19e4c.jpg.png

Note how in this case saving the JPEG lost the MakerNotes. That's either because it was an early version of Adobe support for the R5 or because of Carey's settings. Checking the raw shows the MakerNotes were there:

51d0f0d7288e4530a33fd54d51433a2d.jpg.png

In most galleries these MakerNotes are preserved by Adobe:

8b8c0723996746dd8555d6e3156d3691.jpg.png

I'm not aware of how adobe make the guess between the upper and lower limits, it might be a formula, or perhaps there is additional MakerNote data about the AF system (like there is in µ43 files) that isn't widely known yet.
DPP has 'shooting distance information', that varies from picture to picture, but with no detail
 
Last edited:
These are processed from RAW format. But I was shooting RAW+JPG on some of them, and I can also see the distance information in the original JPGs.
The JPGs tested was actually not 100% untouched. I had used Adobe Bridge to add keywords. Seems Bridge in that process has does something to make the focus distance readable with xIFr.

I just tried an JPG straight out of camera (shot with the EF70-300L), and xIFr is unable to see the distance information. But it must be somewhere in there in proprietary Canon format maybe?
It’s known that FocusDistanceUpper and FocusDistanceLower are in the Canon MakerNotes, but it’s not (widely) know what Adobe do to create the ApproximateFocusDistance.

It’s possible it’s hidden elsewhere in the MakerNotes, or being derived/guessed from additional related data.
 

Keyboard shortcuts

Back
Top