Bug 435317

Summary: GPS image direction incorrectly formatted
Product: [Applications] digikam Reporter: John Gass <john.gass>
Component: Metadata-GpsAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: caulier.gilles, metzpinguin
Priority: NOR    
Version First Reported In: 7.2.0   
Target Milestone: ---   
Platform: Other   
OS: Other   
Latest Commit: Version Fixed/Implemented In: 7.3.0
Sentry Crash Report:
Attachments: JPG image with EXIF GPS & compass data

Description John Gass 2021-04-03 17:12:51 UTC
SUMMARY

GPS image direction is being displayed as "26819/100" when it should be showing "268.19 deg".

STEPS TO REPRODUCE
1. Just inspect any image containing image direction data - I can send you a JPG from my Pentax K3 ii if it would help).

OBSERVED RESULT
26819/100

EXPECTED RESULT
268.19 deg

SOFTWARE/OS VERSIONS
Windows: 10
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 Maik Qualmann 2021-04-03 18:34:48 UTC
A test image would be good to check whether the problem can also be reproduced with the Exiv2 CLI tool.

Maik
Comment 2 John Gass 2021-04-03 18:42:58 UTC
Created attachment 137318 [details]
JPG image with EXIF GPS & compass data

Hope this will do - let me know if I can do anything else to help.
Comment 3 Maik Qualmann 2021-04-03 19:18:38 UTC
Yes, the display of the GPS image direction is identical in the Exiv2 CLI tool. The problem should be reported to Exiv2.

Maik
Comment 4 John Gass 2021-04-10 11:55:37 UTC
Hi,

Just to let you know that I've created a GitHub account and opened a new Exiv2 issue covering this. I'll let you know when it gets resolved.

Many thanks for your support,

John
Comment 5 John Gass 2021-04-10 12:29:07 UTC
Hi again,

I've just received the following email from Exiv2. As you can see, in the short-term at least, they are suggesting that you fix the problem. If you can, that would be great. If not, at least I now know how to interpret the displayed data.

Best regards,

John

===========================================

Thanks for the report.

Using your file I confirm that, exiv2 prints

Exif.GPSInfo.GPSTrackRef Ascii 2 True direction
Exif.GPSInfo.GPSTrack Rational 1 27093/100
Exif.GPSInfo.GPSImgDirectionRef Ascii 2 True direction Exif.GPSInfo.GPSImgDirection Rational 1 32098/100

I agree that it would be nicer to format this differently, eg. 320.98 deg as you suggested.

But I'd not classify this as a bug, as the information is complete and correct.

Thus it's more a wish for different formatting.

As far as I can tell, this would be a change that impacts every consumer of exiv2, and thus I'm not sure if it's something that can be done in a minor release.

Likely more suitable for a future major release. But I'll let @clanmills comment on this.

To be fair, given that all info is available, this seems like a trivial thing to fix on the DigiKam side.
Comment 6 John Gass 2021-04-10 18:08:17 UTC
There's been some more activity on the GitHub thread so, even though none of it seems to change anything significantly, I thought I'd give you the address of their thread so you can follow it if you feel so inclined.

https://github.com/Exiv2/exiv2/issues/1541

Best regards,

John
Comment 7 Maik Qualmann 2021-04-10 20:46:24 UTC
Git commit 003e9fcd5248eaacceed5edc67c8f93bb507453c by Maik Qualmann.
Committed on 10/04/2021 at 20:45.
Pushed by mqualmann into branch 'master'.

add special cases to render contents of GPS info tags
FIXED-IN: 7.3.0

M  +2    -1    NEWS
M  +19   -0    core/libs/metadataengine/engine/metaengine_exif.cpp

https://invent.kde.org/graphics/digikam/commit/003e9fcd5248eaacceed5edc67c8f93bb507453c
Comment 8 Maik Qualmann 2021-04-10 21:08:19 UTC
Git commit 854605d051b79dc2f6d408bcbff12ac1e6b48284 by Maik Qualmann.
Committed on 10/04/2021 at 21:07.
Pushed by mqualmann into branch 'master'.

prevent a possible zero division error

M  +4    -2    core/libs/metadataengine/engine/metaengine_exif.cpp

https://invent.kde.org/graphics/digikam/commit/854605d051b79dc2f6d408bcbff12ac1e6b48284