After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 735914 - EOG's Map plugin crashes on invalid GPS coordinates
EOG's Map plugin crashes on invalid GPS coordinates
Status: RESOLVED FIXED
Product: eog
Classification: Core
Component: general
3.12.x
Other Linux
: Normal normal
: ---
Assigned To: EOG Maintainers
EOG Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-09-02 18:29 UTC by Felipe Lessa
Modified: 2014-09-03 18:14 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Felipe Lessa 2014-09-02 18:29:11 UTC
EOG will crash with the following failed assertion when viewing many (but not all!) images taken with my DMC-TS5 camera:

$ eog teste.jpg 
Duplicate property or field node
Duplicate property or field node
**
ERROR:./champlain-scale.c:253:redraw_scale: assertion failed: (base > 0)
Abortado (imagem do núcleo gravada)

$ LC_ALL=C eog --version
GNOME Image Viewer 3.12.2

I'm attaching both a test image and a core dump generated from trying to open it.
Comment 1 Felipe Lessa 2014-09-02 18:37:48 UTC
Well, it seems I can't attach either due to size limits.  

You can download the test image from Google Drive, just click on the download icon at the top toolbar:
https://docs.google.com/file/d/0B1RQL7VdLXBkbTZQR09TX2NTd1E/

Fun fact.  After imgur's post processing, EOG is able to open the file just fine:
http://imgur.com/caHCbvq
Comment 2 Felix Riemann 2014-09-02 19:54:49 UTC
Oh, the GPS coordinates saved in the file seem a bit off:

GPS Altitude                    : 1143 m Above Sea Level
GPS Date/Time                   : 0000:00:00 00:00:00Z
GPS Latitude                    : 17056881 deg 51' 12.15" N
GPS Longitude                   : 17056881 deg 51' 12.15" E
GPS Position                    : 17056881 deg 51' 12.15" N, 17056881 deg 51' 12.15" E

imgur is stripping off the metadata, so they don't cause any harm afterwards. 
These coordinates are apparently causing the Map plugin to go off limits, so if it is a showstopper for you. Although, I am not sure if that is really fixable.
Comment 3 Felipe Lessa 2014-09-02 20:15:56 UTC
So there are actually two bugs:

  1. EOG's Map plugin crashes on invalid positions.  It should just ignore that the image has a position instead.

  2. EOG's library that reads EXIF information needs a fix to read that GPS position.  I know *something* can be done about it because Flickr correctly puts the images on the map.

I'm going to rename this issue so that it reflects bug 1.  Where should I file a issue for bug 2?
Comment 4 Felipe Lessa 2014-09-02 20:22:10 UTC
Hmmm, actually, I'm wrong about bug 2 above.  

I went to Flickr to confirm that it is able to show the position of this particular image and, surprise, it doesn't!  Then I've checked one of the images that Flickr does show on a map, and, surprise again, EOG and the Map plugin both work!

Perhaps there is a bug on my camera that puts that bogus data whenever it is not able to fix the GPS position.  The test image I've posted here was taken indoors where it rarely gets a GPS fix.  If that's the case, bug 2 doesn't exist and only bug 1 remains relevant.
Comment 5 Felix Riemann 2014-09-03 17:24:04 UTC
Well, there's also this tag:

GPS Status                      : Measurement Void

it knows "Active" as well. However it doesn't seem to be great for compatibility to rely on this field as I have images with this tag that still have valid coordinates.

We should probably just check that the angles make sense (+-90/+-180).
Comment 6 Felipe Lessa 2014-09-03 17:51:23 UTC
I agree!  That would solve this problem
Comment 7 Felix Riemann 2014-09-03 17:58:34 UTC
There we go. Longitude is limited to +-180° and latitude to +-90°.

commit 74bdd4aa13b8f64459ef4f3004ddf27acbb510e6
Author: Felix Riemann <>
Date:   Wed Sep 3 19:45:48 2014 +0200

    map: Perform simple validation on extracted coordinates
    
    Simply check whether the angles make sense. That should avoid hitting
    an assertion in libchamplain with images having bogus values.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=735914

Maybe you could still report this to libchamplain as well. I'd say libchamplain shouldn't accept such values either.
---
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.
Comment 8 Felipe Lessa 2014-09-03 18:14:25 UTC
Many thanks!  I've filed bug #735986.