Bug 308712 - Geolocation window corrupts XMP files
Summary: Geolocation window corrupts XMP files
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Metadata-Gps (show other bugs)
Version: 2.8.0
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-20 15:07 UTC by james
Modified: 2017-08-11 21:59 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.1.0


Attachments
Image with strange value in EXIF User Comment field (18.65 KB, image/jpeg)
2012-10-23 19:47 UTC, james
Details

Note You need to log in before you can comment on or make changes to this bug.
Description james 2012-10-20 15:07:18 UTC
Digikam will not write Geolocation information to an XMP sidecar file; instead, a corrupt sidecar file is generated. If a sidecar file already exists, it is overwritten by the corrupt file.

Reproducible: Always

Steps to Reproduce:
0. Set Digikam to write metadata to sidecar files
1. Select image, open Geolocation dialog from Image menu
2. Drag image onto map
3. Click Apply
Actual Results:  
XMP file is generated with only "<?xml version="1.0" encoding="UTF-8"?>" as the contents.

Expected Results:  
Geolocation information is written to the XMP file.
Comment 1 caulier.gilles 2012-10-20 15:10:28 UTC
It's probably relevant of Exiv2. Can you reproduce using Exiv2 command line tool  ?

Gilles Caulier
Comment 2 james 2012-10-20 15:29:31 UTC
Sorry, I wouldn't know what parameters or options I should be giving the exiv2 command line tool.
Comment 3 james 2012-10-20 16:44:36 UTC
I did a test with the same image in Geeqie. That too issued the same truncated XMP file when writing metadata. In the terminal window was the message:

  Error: XMP Toolkit error 4: Invalid UTF-8 sequence length 
  Error: Failed to encode XMP metadata.
  Error: XMP Toolkit error 4: Invalid UTF-8 sequence length
  Error: Failed to encode XMP metadata.

The image in question was taken by a Samsung Galaxy S3 which for some reason embeds the caption "ΓΈ;" (including two nonprintable characters) in every photo. I re-tested Digikam with an image from a Canon 550D (which embeds no such nonsense), and the bug did not occur.

Googling these error messages turned up this: http://dev.exiv2.org/boards/3/topics/1073

Is it possible that exiv2 is being fed non-UTF-8 characters, triggering the error?
Comment 4 caulier.gilles 2012-10-20 16:51:33 UTC
Andreas,

Comment #3 is for you...

Gilles Caulier
Comment 5 Marcel Wiesweg 2012-10-23 19:22:00 UTC
I understand to reproduce, one needs a special file which contains possibly invalid data in the XMP. Can you provide an image file for testing?
Comment 6 james 2012-10-23 19:47:57 UTC
Created attachment 74761 [details]
Image with strange value in EXIF User Comment field

No problem, here you go. Shrunken from original but still exhibits the problem.
Comment 7 Marcel Wiesweg 2012-10-26 10:58:34 UTC
The attached photo does not seem to have any metadata, neither Exif, not IPTC, XMP nor a JPEG comment.
Comment 8 Marcel Wiesweg 2013-01-12 16:12:20 UTC
Not reproducible as provided image does not seem to have any metadata
Comment 9 caulier.gilles 2015-06-30 08:08:01 UTC
New digiKam 4.11.0 is available :

https://www.digikam.org/node/740

Can you reproduce the problem with this release ?
Comment 10 caulier.gilles 2015-08-21 07:04:54 UTC
digiKam 4.12.0 is out :

https://www.digikam.org/node/741

We need a fresh feedback using this release please...
Thanks in advance.
Comment 11 caulier.gilles 2016-07-14 13:01:32 UTC
This problem is not reproducible using last digiKam 5.0.0 + Exiv2 0.25.
I close this file now. Don't hesitate to re-open if necessary.
Gilles Caulier