Open Self-Perfection opened 5 years ago
If you open View/Exif window you will see that there are two values for Exif.GPSInfo.AltitudeRef. The spec. defines this field as a byte: 0 = above sea level, 1 = below sea level, other values = reserved. Therefore the second item is the correct one.
Geeqie makes only one call for each parameter, and in this case tests the received value for value == 0 (thus it sees 200/100 as below sea level). I guess the test could be changed to value == 1, but I am not sure that is the right way to go. If I have time I will try to find how the other programs handle this.
Two separate ideas:
1) Given a spec defining 0 and 1 and everything else reserved, how about processing by checking first if the altituderef field is a byte, and then if so looking for 0 and 1 and handling those as is, and other values printing "invalid reference" for altitude ref? And printing invalid if the field is not a byte?
2) exiftool -n -e
prints GPS Altitude Ref : 0
. But indeed geeqie's browser shows a field of type rational with 220/100 and a field of type byte with 0. So while this image has invalid exif, I wonder if it is reasonable to just ignore values of type rational. Alternatively, a simple "is there only one value" could be added, leading to "invalid reference".
I think the big question is how much workaround code should be added for invalid input.
In #1034 @kha84 suggested using exiftool instead of exiv2. That would solve the problem - but unfortunately there is not a simple one-to-one correspondence between the two libraries.
And exiftool is in perl, which really doesn't seem ok to add.
ISSUE TYPE
GEEQIE VERSION
OS / DISTRIBUTION
Arch linux
SUMMARY
Geeqie shows altitude for all photos taken with Xioami Mi A1 as "below sea level". Digikam, Gwenview and exiftool correctly indicate it as above sea level.
STEPS TO REPRODUCE
Here is sample image: This is how Geeqie parses metadata: