GPS Altitude and GIMP 2.8 / above sea level to below sea level

Started by robbie.morrison, March 04, 2017, 04:41:31 PM

Previous topic - Next topic

robbie.morrison

This post concerns GPS metadata from a Nikon NRW file being corrupted on saving as an XCF file with GIMP 2.8.

The problem probably resides with GIMP but I thought I should mention it here because it could be useful to flag the issue. Alternatively but unlikely, the problem could arise from ExifTool.

Operating system: Ubuntu 16.10 / Linux 4.8.0-39-generic
Versions: GIMP 2.8.18 / ExifTool 10.45 / ImageMagick 6.8.9-9 / exiv2 0.25 001900.
Camera: Nikon CoolPix P330 / firmware version 1.1

I have searched the web and this forum and not turned up much of merit.

The procedure was to use GIMP to open a NRW file and then immediately save it as an XCF file. At which point the following resulted:

$ exiftool -GPSAltitude 2017-rosenthal-cemetery-4809.nrw
GPS Altitude                    : 62.3 m Above Sea Level

$ exiftool -GPSAltitude 2017-rosenthal-cemetery-4809.xcf
GPS Altitude                    : 62.3 m Below Sea Level

To investigate further:

$ exiftool -duplicates -groupNames -s 2017-rosenthal-cemetery-4809.nrw | grep --ignore-case altitude
[EXIF]          GPSAltitudeRef                  : Above Sea Level
[EXIF]          GPSAltitude                     : 62.3 m
[Composite]     GPSAltitude                     : 62.3 m Above Sea Level

$ exiftool -duplicates -groupNames -s 2017-rosenthal-cemetery-4809.xcf | grep --ignore-case altitude
[EXIF]          GPSAltitudeRef                  : Above Sea Level
[EXIF]          GPSAltitude                     : 62.3 m
[XMP]           GPSAltitudeRef                  : Unknown (Sea level)
[XMP]           GPSAltitude                     : 62.30 m
[Composite]     GPSAltitude                     : 62.3 m Below Sea Level

I played around with exif, exiv2, and identify but they did not contribute much more insight. Here is the output from ImageMagick on the NRW file:

$ identify -verbose 2017-rosenthal-cemetery-4809.nrw | grep --ignore-case altitude
    exif:GPSAltitude: 6230/100
    exif:GPSAltitudeRef: 0
$ identify -verbose 2017-rosenthal-cemetery-4809.xcf | grep --ignore-case altitude
no output when used with the grep filter

And also, while noting that exiv2 cannot read XCF files (the tr call strips out a null char because grep expects clean text):

$ exiv2 -p a 2017-rosenthal-cemetery-4809.nrw | tr --delete '\000' | grep --ignore-case altitude
2017-rosenthal-cemetery-4809.nrw: (No XMP data found in the file)
Exif.GPSInfo.GPSAltitudeRef                  Byte        1  Above sea level
Exif.GPSInfo.GPSAltitude                     Rational    1  62.3 m

It is probably not worth submitting a bug report to GIMP because the Exif/metadata reporting and editing code has now been reworked in the experimental 2.9 track.

Comments would, as ever, be useful.

best wishes, Robbie

PS: thanks for "Version 10.43: Lowered priority of XMP-pdf:Keywords so it doesn't take precedence over PDF:Keywords when the Duplicates option is not used."


robbie.morrison

To continue, we can convert the NRW image to PNG using ImageMagick (this convert utility cannot convert to XCF):

$ convert 2017-rosenthal-cemetery-4809.nrw 2017-rosenthal-cemetery-4809.imagemagick.png

And then:

$ exiftool -GPSAltitude 2017-rosenthal-cemetery-4809.imagemagick.png
GPS Altitude                    : 62.3 m Above Sea Level

This suggests the problem lies with GIMP.

best wishes again, Robbie

Alan Clifford

I've had problems with XMP with Gimp.  I can't remember the problem but I have the saving of XMP disabled.  This is just editing a jpg, which gimp has converted to its own type, and then saving the edited photo to a new jpg.



robbie.morrison

Hello Alan

My trials show that once GIMP has decided incorrectly that the GPS altitude is below sea level. then it happily copies that spurious information when exporting to JPG (given that the Export EXIF data and Export XMP data options are checked on export).

Robbie

Phil Harvey

The seems to be with only the GIMP XMP.  It looks to me as if GIMP is writing the string "Sea Level" to the XMP GPSAltitudeRef, while it should either be a "0" or "1".

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

robbie.morrison

Thanks Phil

As note earlier, there is not much point in contacting GIMP. Even as far back as 2013, the development track had reworked their support for metadata. Apparently that effort closed "no less than 12 metadata related bugs". (Prokoudine 2013)  We therefore patiently await for GIMP 2.10 in due course.

Robbie

Reference: Prokoudine, Alexandre (29 October 2013). GIMP gets advanced Exif, XMP, IPTC metadata support. Libre Graphics World. http://libregraphicsworld.org/blog/entry/gimp-gets-advanced-exif-xmp-iptc-metadata-support

Phil Harvey

Hi Robbie,

Interesting that your reference quotes Michael Steidl -- I have helped him to generate test files for the last couple of IPTC for XMP specification revisions (which is great because it means that ExifTool has been very up-to-date when it come to IPTC support).

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).