-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Offset when parsing Exif GPSLatitude/GPSLongitude with QGIS expression #57942
Labels
Bug
Either a bug report, or a bug fix. Let's hope for the latter!
Comments
boardend
added a commit
to boardend/QGIS
that referenced
this issue
Jun 30, 2024
…nal of QgsExifTools (fixes qgis#57942)
boardend
added a commit
to boardend/QGIS
that referenced
this issue
Jun 30, 2024
…nal of QgsExifTools (fixes qgis#57942)
nyalldawson
pushed a commit
that referenced
this issue
Jul 3, 2024
…nal of QgsExifTools (fixes #57942)
nyalldawson
pushed a commit
that referenced
this issue
Jul 3, 2024
…nal of QgsExifTools (fixes #57942)
elpaso
pushed a commit
to elpaso/QGIS
that referenced
this issue
Jul 11, 2024
…nal of QgsExifTools (fixes qgis#57942)
nyalldawson
pushed a commit
that referenced
this issue
Jul 19, 2024
…nal of QgsExifTools (fixes #57942)
nyalldawson
pushed a commit
that referenced
this issue
Jul 20, 2024
…nal of QgsExifTools (fixes #57942)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What is the bug or the crash?
Noticed with an image from a Samsung Galaxy Tab Active 4 Pro (SM-T636B) that the position is slightly off, when using
exif
/exif_geotag
expressions in QGIS.GPSLatitude/GPSLongitude are stored as
rational64u[3]
, with a rational for degrees, minutes and seconds. If the numerator or denominator of such a rational is bigger then2^32/2
(2147483648
), theint32_t
will turn negative and lead to a wrong result while parsing the x/y value to adouble
in theQgsExifTools
.Note that this only happens with some sensors/images. With most sensors the numerator/denominator will be below the
2^32/2
threshold and the position will be accurate.Example image (reduced to 1x1 px, but with preserved Exif metadata) can be obtained here: gps_exif_example.zip
Steps to reproduce the issue
exif_geotag
expression in QGIS to read the position of thegps_exif_example.jpg
47.766666666663134
/8.66666666666483
👎gps_exif_example.jpg
with "Import geotagged photos"-Algorithm47.781829000012785
/8.674557000032523
👍Versions
Tested with 3.34.8 and latest master (
6246369
) with Exiv2 0.27.5Supported QGIS version
New profile
Additional context
GPSLatitude/GPSLongitude parsing of
gps_exif_example.jpg
Exiv2::Value
) rationals withint32_t
as:47/1
deg.,46/1
min.,-1/78684886
sec.4294967295/78684886
withuint32_t
Exiv2::Value
) rationals withint32_t
as:8/1
deg.,40/1
min.,-1/151203557
sec.4294967295/151203557
withuint32_t
Output of
exiv2 -Pvkyct gps_exif_example.jpg | grep GPS
:Output of
exiftool -n -ee '-gps*' gps_exif_example.jpg
:The text was updated successfully, but these errors were encountered: