Exif's GPSLatitude & GPSLongitude type definition should be number[][] rather than number[].
getCalculatedGpsValue expects each of its first 3 function parameters (degrees, minutes, seconds) to be a number[]. Each parameter is based on value[0], value[1], and value[2] of GPSLatitude & GPSLongitude. Thus the value prop has a type of number[][].
Additional details
ExifReader version: 4.21.1
Web browser and version: chrome Version 123.0.6312.107 (Official Build) (arm64)
Node version: N/A
Can you reproduce the bug on the examples site? N/A
I was trying to replicate the computation of the latitude and longitude based on GPSLatitude/GPSLongitude & GPSLatitudeRef/GPSLongitudeRef. The same computation that ExifReader's getCalculatedGpsValue performs. https://mattiasw.github.io/ExifReader/
How to reproduce
Read the tags from an Android photo using the example site's ES module
Take the tags' GPSLatitude/GPSLongitude and pass it to a typescripted function akin to getCalculatedGpsValue such as gpsDMSToFloat(latLng: NumberArrayTag, latLngRef: StringArrayTag)
Description
Exif's GPSLatitude & GPSLongitude type definition should be number[][] rather than number[].
getCalculatedGpsValue expects each of its first 3 function parameters (degrees, minutes, seconds) to be a
number[]
. Each parameter is based onvalue[0], value[1], and value[2]
of GPSLatitude & GPSLongitude. Thus thevalue
prop has a type ofnumber[][]
.Additional details
getCalculatedGpsValue
performs. https://mattiasw.github.io/ExifReader/How to reproduce
Take the tags' GPSLatitude/GPSLongitude and pass it to a typescripted function akin to
getCalculatedGpsValue
such asgpsDMSToFloat(latLng: NumberArrayTag, latLngRef: StringArrayTag)
latLngDeg, latLngMin, latLngSec
What I expected would happen:
No typescript error associated with accessing
value
of GPSLatitude/GPSLongitude in the manner shown above.What really happened:
Typescript error regarding
latLngDeg, latLngMin, latLngSec
Example JPEG image