Skip to content
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

Respect Exiv2::Value type (Exiv2::unsignedRational) in readRational of QgsExifTools (fixes #57942) #57943

Merged
merged 2 commits into from
Jul 3, 2024

Conversation

boardend
Copy link
Contributor

@boardend boardend commented Jun 30, 2024

Description

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 then 2^32/2 (2147483648), the int32_t will turn negative and lead to a wrong result while parsing the x/y value to a double in the QgsExifTools

This PR adresses this by using uint32_t on Exiv2::unsignedRational

@github-actions github-actions bot added this to the 3.40.0 milestone Jun 30, 2024
@boardend boardend changed the title Respect Exiv2::Value type (e.g. Exiv2::unsignedRational) in readRational of QgsExifTools (fixes #57942) Respect Exiv2::Value type (Exiv2::unsignedRational) in readRational of QgsExifTools (fixes #57942) Jun 30, 2024
@boardend boardend force-pushed the fix-exiv2-gps-unsignedrational branch from e90bc5d to 7c5b131 Compare June 30, 2024 13:24
@nirvn
Copy link
Contributor

nirvn commented Jun 30, 2024

Good catch

Copy link

github-actions bot commented Jun 30, 2024

🪟 Windows builds ready!

Windows builds of this PR are available for testing here. Debug symbols for this build are available here.

(Built from commit e44e589)

@m-kuhn
Copy link
Member

m-kuhn commented Jul 1, 2024

@nirvn as for the test failures, is this conversion to int intended? It seems to trigger on code by you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Offset when parsing Exif GPSLatitude/GPSLongitude with QGIS expression
4 participants