ExifTool Forum

ExifTool => Bug Reports / Feature Requests => Topic started by: johnrellis on May 22, 2023, 11:36:50 PM

Title: Incorrect value for infinity in EXIF:SubjectDistance
Post by: johnrellis on May 22, 2023, 11:36:50 PM
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
Title: Re: Incorrect value for infinity in EXIF:SubjectDistance
Post by: Phil Harvey on May 24, 2023, 10:29:48 AM
The EXIF specification is stupid.  Yes, you are correct that ExifTool uses the standard representation for infinity rather than the stupid EXIF recommendation.

- Phil