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 786813 - GIMP corrupts GPS EXIF information of jpg file
GIMP corrupts GPS EXIF information of jpg file
Status: RESOLVED OBSOLETE
Product: GIMP
Classification: Other
Component: General
2.8.22
Other All
: Normal minor
: ---
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2017-08-25 18:48 UTC by Pedro
Modified: 2018-05-24 18:20 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Pedro 2017-08-25 18:48:03 UTC
I can reproduce this bug doing this simple operation:
 1 - open a JPG file with Gimp
 2 - export the file as JPG

The GPS EXIF information of the saved file differs from the original file in 2 fields:

Original:
  GPS Altitude: 821 m Above Sea Level
  GPS Longitude Ref: West

Saved with Gimp:
  GPS Altitude: 821 m Below Sea Level
  GPS Longitude Ref: East

Using Gimp 2.8.10 / Ubuntu 14.04LTS 64bits
Comment 1 André Klapper 2017-08-26 10:19:34 UTC
Thanks for taking the time to report this.
However, you are using a version that is too old and not supported anymore by GIMP developers.
Please feel free to reopen this bug report if the problem still occurs with a recent version of GIMP, or feel free to report this bug in the bug tracking system of your Linux distribution if your distribution still supports the version that you are using.
Furthermore, please provide exact steps to reproduce the problem plus a test case. I do not know how and where you checked the GPS data, for example.
Comment 2 Pedro 2017-08-26 16:28:53 UTC
Hi, I tested again with Gimp 2.8.22 and it has the same bug.

A image file with GPS tags can be created by a cellphone with "geo tag" enabled in the camera app, or with a camera that has GPS. I put a sample file here: http://pzn.com.br/gimp-786813/

Steps to reproduce:
  1 - run "exiftool" or any other exif application that shows the exif tags on the file original.jpg and see the GPS tags
  2 - open "original.jpg" with gimp, and export it as "exported.jpg"
  3 - run "exiftool" on "exported.jpg" and check the GPS tags

  You can see that there may be some "sign-related" bug, since "above" changes to "below" and "east" changes to "west".

$ exiftool original.jpg | grep -i GPS | sort
GPS Altitude                    : 828 m Above Sea Level
GPS Altitude Ref                : Above Sea Level
GPS Date Stamp                  : 2017:08:25
GPS Date/Time                   : 2017:08:25 19:34:18Z
GPS Latitude                    : 21 deg 58' 50.99" S
GPS Latitude Ref                : South
GPS Longitude                   : 47 deg 56' 19.89" W
GPS Longitude Ref               : West
GPS Position                    : 21 deg 58' 50.99" S, 47 deg 56' 19.89" W
GPS Time Stamp                  : 19:34:18
GPS Version ID                  : 2.2.0.0

$ exiftool exported-by-gimp.jpg | grep -i GPS | sort
GPS Altitude                    : 828 m Below Sea Level
GPS Altitude Ref                : Above Sea Level
GPS Date Stamp                  : 2017:08:25
GPS Date/Time                   : 2017:08:25 19:34:18Z
GPS Latitude                    : 21 deg 58' 50.99" S
GPS Latitude Ref                : South
GPS Longitude                   : 47 deg 56' 19.89" W
GPS Longitude Ref               : East
GPS Position                    : 21 deg 58' 50.99" S, 47 deg 56' 19.89" W
GPS Time Stamp                  : 19:34:18
GPS Version ID                  : 2.2.0.0

$ exiftool original.jpg | grep -i GPS | sort > orig.txt

$ exiftool exported-by-gimp.jpg | grep -i GPS | sort > gimp.txt

$ diff -u orig.txt gimp.txt | grep ^[+-]G
-GPS Altitude                    : 828 m Above Sea Level
+GPS Altitude                    : 828 m Below Sea Level
-GPS Longitude Ref               : West
+GPS Longitude Ref               : East

# Note: installed exiftool from ubuntu package "libimage-exiftool-perl" version 9.46-1
Comment 3 Edward E. 2017-08-30 04:39:35 UTC
GIMP 2.8 can sometimes export broken XMP data (see bug 746958), in this case it's duplicating EXIF data into XMP data. See http://dev.exiv2.org/issues/0001276

  $ exiv2 -px exported-by-gimp.jpg
  Error: XMP Toolkit error 203: Duplicate property or field node
  Warning: Failed to decode XMP metadata.

Meanwhile, exiftool seems to incorrectly interpret some EXIF GPS tags that it reads from XMP (I used exiftool 10.61 on Windows, same results as in comment 2). To see that the actual embedded metadata is correct, try

  $ exiftool -v exported-by-gimp.jpg | grep -i GPS

or check it in a viewer (IrfanView in my case).

GIMP 2.8.22 on Windows (32-bit) exports a jpeg identical to 'exported-by-gimp.jpg' (except for timestamps etc.), so this is probably platform independent. GIMP 2.9.7 (commit 188a8255) exports a jpeg with apparently good metadata tags:

  $ exiv2 -px exported-by-gimp-2.9.7.jpg

shows XMP data that doesn't contain duplicated EXIF GPS tags. Also,

  $ exiftool exported-by-gimp-2.9.7.jpg

displays the GPS tags correctly.

To mitigate this problem: if you keep using GIMP 2.8, and you don't need XMP data, you can turn off "Save XMP data" under "Advanced Options" when exporting as JPEG; the GPS tags will still be in the EXIF header.
Comment 4 Michael Schumacher 2017-08-30 13:32:22 UTC
metadata handling has changed completely for 2.9 - and IIRC no one wants to change anything for 2.8 in that regard anymore. If there's a contributed patch, it will be considered, though.
Comment 5 Pedro 2017-08-30 17:23:51 UTC
Considering comments 3 and 4, I think there is no need to make efforts to fix it. The mitigation action (disable XMP save data) is a good option for those who have 2.8 installed.
Comment 6 Kunda 2018-05-21 15:28:06 UTC
Since a fix wont be backported should this ticket be closed ?
Comment 7 GNOME Infrastructure Team 2018-05-24 18:20:48 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gimp/issues/1175.