5

I have extracted the metadata from an image. One of the values was:

FocalLength: (3680, 1000)

How can we read the above value?

1 Answer 1

11

Values in Exif metadata can be stored as various data types, including ASCII text strings, "short" or "long" integers, or "rationals". A short integer is stored in two bytes; a long integer takes four bytes. A "rational" is:

Two LONGs. The first LONG is the numerator and the second LONG expresses the denominator.

That is,FocalLength: (3680, 1000) means 3680 / 1000, or 3.68. (Elsewhere in the spec, this is defined to be in millimeters.) For whatever reason, whatever program you are looking at this with is just showing you the two "long" values rather than doing the math for you.

It's also incredibly important to note that hundredths of a millimeter is almost certainly excess precision. For practical use, call this 3.7mm or 4mm.

10
  • Why don't we ever see a prime number as the denominator in such a string? ;-)
    – Michael C
    Jul 7, 2017 at 20:09
  • 1
    @MichaelClark It's weird, yeah. In fact, why not just use 1 in most cases? My Pentax and Fujifilm cameras use 100 in the denominator. Files I have from a Nikon use 10, and those from my smartphone use 1000. A couple of iPhone files I have use 20 (iPhone 5) and 25 (iPhone 5s).
    – mattdm
    Jul 7, 2017 at 20:26
  • 1
    If this is from a phone camera, 3.68 might be excess precision, but 3.7 isn't: the tiny sensor means the overall range of even a long zoom lens isn't very large.
    – Mark
    Jul 7, 2017 at 22:37
  • 1
    @MichaelClark - I think what he's saying is that when sensors and respective FLs become tiny, mm becomes an increasingly coarse unit, possibly not suitable for some purposes when rounded... Jul 7, 2017 at 23:01
  • 1
    It's true that millimeters are a course unit. My point is that I doubt the focal length given is accurate to that precision, at least not for any practical purpose like measuring things, as people tend to come here wanting to do.
    – mattdm
    Jul 8, 2017 at 15:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.