# Lightroom: EXIF metadata SubjectDistance bug

• Problem
• Updated 9 years ago
Hi.
I've just discovered that Lightromm 3.4 and earlier wrongly displays SubjectDistance EXIF tag if camera focus distance was set to infinity.

According to EXIF specification SubjectDistance tag is stored using two numbers - numerator and denominator.

And if numerator is zero - subject distance should be reported as unknown and if it is set to 0xFFFFFFFF - subject distance is infinity.

Quote from EXIF 2.2 specification:

SubjectDistance:
The distance to the subject, given in meters. Note that if the numerator of the recorded value is FFFFFFFF.H,
Infinity shall be indicated; and if the numerator is 0, Distance unknown shall be indicated.

But instead of displaying infinity - lightroom shows numeric value.

For example, in my photo I have numerator equal to 0xFFFFFFFF and denominator equal to 1000.

Lightroom reports distance of 4.29 Mm (million of meters 0xFFFFFFFF/1000 = 4294967295/1000 = 4.29*10^6), which is numerically right, but should be reported as infinity.
At the moment, Lightroom shows infinity ONLY if the numerator is 0xFFFFFFFF AND denominator is 1, which is wrong.
According to EXIF specification, if the numerator is 0xFFFFFFFF - denominator does not matter at all.
• 13 Posts

Posted 9 years ago

• 146 Posts
FWIW, Exif 2.3 says the same thing, and LR 3.4 shows ∞ for some of my D700 shots.

Interestingly, exiftool shows smaller numbers for FocusDistance than Lightroom does -- I have two examples. In both, LR shows ∞ while exiftool shows 3.98m and 18.84m. But after viewing a few more that I'd think were shot at ∞ I'm not sure I trust exiftool on this.

I'm not sure how to view the raw data easily so that I can see the numerator and denominator separately. What are you using?
• 136 Posts
Mark, slightly off-topic but are you saying that you see Subject Distance in the Metadata Panel in LR 3.4? I thought that was something that was 'lost' in the upgrade from 2.7 to 3.0 (vaguely recall some discussion about it at the time)? For sure I definitely do not see Subject Distance in 3.4, though the same file in 2.7 does present it.
• 146 Posts
Jim, this may depend on which metadata view you're using. Looks like it's not in any of Lightroom's standard views, but I have my own custom view which does include it.
• 13 Posts
Hi. I'm using my own parser.
Run it as dng_validate -v raw_file.dng and it will show you something like this:
SubjectDistance: 14/2
To test Lightroom you can use exiftool.
Note 0xFFFFFFFF = 4294967295
Execute "exiftool -SubjectDistance=4294967295/1 raw_file.dng" -> lightroom will show infinity.
But if you run "exiftool -SubjectDistance=4294967295/1000 raw_file.dng" -> it will show you millions of meters instead of infinity.

Benjamin Warde, Employee

• 488 Posts
I'm a little confused. Lightroom 3.4 does not normally display the "Subject Distance" EXIF tag anywhere in the UI at all. The "Subject Distance" EXIF tag is available via the SDK, so it is possible that a plugin could be accessing and displaying the tag. Do you have a plugin installed that might be doing this? If so, and it's displaying incorrectly, it's hard to say if it would be a Lightroom bug or a bug in a third party plugin. Could you tell me the name of the plugin, if indeed you are using one? And if you're not, can you tell me how you're getting Lightroom to display the "Subject Distance" tag? Or am I just misunderstanding this post entirely?

Thanks,
Ben
• 146 Posts