Incorrect value for infinity in EXIF:SubjectDistance

Started by johnrellis, May 22, 2023, 11:36:50 PM

Previous topic - Next topic

johnrellis

ExifTool doesn't use the correct representation of infinity for EXIF:SubjectDistance. The spec defines it as a rational, saying:

QuoteNote 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 using Exiftool to set SubjectDistance to "inf" stores the rational 1/0:
$ exiftool -subjectdistance=inf a.jpg
    1 image files updated
$ exiftool -subjectdistance a.jpg
Subject Distance                : inf
$ exiftool -v a.jpg | grep SubjectDistance
  | | 12) SubjectDistance = inf (1/0)

To store a correct value of infinity, you need to use this workaround:
$ exiftool -subjectdistance=4294967295 a.jpg
    1 image files updated
$ exiftool -subjectdistance a.jpg
Subject Distance                : 4294967295 m

Phil Harvey

The EXIF specification is stupid.  Yes, you are correct that ExifTool uses the standard representation for infinity rather than the stupid EXIF recommendation.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).