broken xmp files

Phil philtuckey at
Sun Oct 22 10:28:09 BST 2017

There is a long-standing bug concerning simultaneous tagging of multiple 
images under OS X/macOS:

The metadata write fails for a small number of images, apparently 
randomly-chosen among all the images. This affects both writing tags to 
the image files and writing sidecars. (The bug report is from 2016 but I 
noticed this and wrote to the list about it years ago.)

I gave quite a lot of details in the bug report, so that should help to 
decide if you have met the same problem.

In particular, are you working on a Mac?

I note that you said the problem affects half of your 1000 images, 
whereas I usually see only a few %. But my tests use about a 100 images, 
perhaps the problem becomes proportionally worse as the number of images 

Gilles Caulier believes the problem is due to the Exiv2 library. As I 
commented in the bug report, I do not think the evidence proves this, it 
could also be a problem in the digiKam data structures or calls to Exiv2 
(specific to Mac).

Like you, I commonly tag multiple files simultaneously, for example when 
I load all the images from an event and want to give them all the same 
caption and some keywords.

I have never met this problem on linux. Therefore to avoid it, I do my 
tagging in dk running under a linux virtual machine. I share the image 
files and dk databases from macOS to the VM, so I can run dk both in the 
VM and in native (not at the same time!). In practice this is not 
completely comfortable, and I tend not to use dk in native for anything 
other than viewing (not even tagging or editing individual images).

For your information, you can repair the incomplete sidecars or image 
file tags by writing them out individually, i.e. by selecting the image 
and then using
Item -> Write Metadata to Image
since the bug never seems to occur when dealing with individual images. 
Apart from the tediousness of remembering to do this every time one tags 
multiple images, I have never completely convinced myself that the 
resulting sidecars or image files are identical to what they would have 
been without the bug.

To rewrite the sidecars (or image file tags) for multiple images you can 
select them all and use the above, or for a complete album use
Album -> Write Metadata to Image
but in both cases the bug will occur again.


On 22/10/17 04:35, Dan McDaniel wrote:
> Thanks. I'll give that a try. Is there a way to force it to re-write all
> the xmp files?
> On Sat 21.Oct.17 19:41, Andrey Goreev wrote:
>> I think Maik might already fixed this. I do recall having a similar 
>> conversation a couple of months ago.Have you tried pre-release bundle 
>> ver. 5.8.0 ?
>> Sent from my Samsung Galaxy smartphone.
>> -------- Original message --------From: Dan McDaniel <dan at> 
>> Date: 2017-10-21  7:34 PM  (GMT-07:00) To: digikam-users at 
>> Subject: broken xmp files
>> I'm using 5.7.0 on a Mac.
>> I used Digikam to tag and rate about 1000 images, a combination of jpegs
>> and raws. For about half of them Digikam didn't write a complete xmp
>> file, but only the first line:
>>   <?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?>
>> On some of them I tried going back into DK and changing the star rating.
>> This caused it to write out the xmp file including the rating. But it
>> didn't write the tags. To get DK to write the tags I had to make a
>> change to a tag. Then to get it to write the title you have to make a
>> change to the title and so on. Basically, you have to remove stars,
>> tags, titles, and everything and add them back in to force DK to write
>> them out to the xmp file.
>> I hope that this can be fixed because as-is DK isn't very useful to me.
>> -- 
>> Dan McDaniel

More information about the Digikam-users mailing list