Lightroom: EXIF metadata SubjectDistance bug

  • 1
  • Problem
  • Updated 8 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.
Photo of Alexander

Alexander

  • 13 Posts
  • 1 Reply Like

Posted 8 years ago

  • 1
Photo of Mark Sirota

Mark Sirota

  • 146 Posts
  • 29 Reply Likes
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?
Photo of Jim Wilde

Jim Wilde

  • 136 Posts
  • 26 Reply Likes
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.
Photo of Mark Sirota

Mark Sirota

  • 146 Posts
  • 29 Reply Likes
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.
Photo of Alexander

Alexander

  • 13 Posts
  • 1 Reply Like
Hi. I'm using my own parser.
But you can use dng_validate tool from adobe dng sdk (available for free).
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.
Photo of Benjamin Warde

Benjamin Warde, Employee

  • 484 Posts
  • 76 Reply Likes
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
Photo of Mark Sirota

Mark Sirota

  • 146 Posts
  • 29 Reply Likes
Jim and Ben, I've just published a writeup on Customizing your Metadata panel over at Lightroom Forums. Here's a screen shot of my Metadata panel:
Photo of Jim Wilde

Jim Wilde

  • 136 Posts
  • 26 Reply Likes
Mark, thanks very much. Have just been having a read and no doubt I'll have a go in due course!
Photo of Benjamin Warde

Benjamin Warde, Employee

  • 484 Posts
  • 76 Reply Likes
Thanks Mark. And if I understand your previous post, Lightroom is displaying infinite subject distance correctly for you? If so, then it seems that the problem Alexander is having is either due to a bug in a plugin, or perhaps it's camera-specific.
Photo of Mark Sirota

Mark Sirota

  • 146 Posts
  • 29 Reply Likes
That would be my guess, Ben. Alexander, if you could post a sample camera-generated file that exhibits this problem, it would help others to investigate. Experimenting with a real file rather than one manipulated by exiftool takes that variable out of the equation. (What cameras are generating these files?)