Darktable: image corruption on import of existing library

Well, this was a full clean installation of Kubuntu, so I didn’t have an existing database to work with. I guess I didn’t have the foresight to put my library.db in my separate partition. I do have a partition where I keep my user files (and photos), but it is not my /home directory.
Looks like I need to put library.db and data.db in a safe place.

What should be darktable’s expected behavior when importing images that have sidecar files? (Given a new installation of darktable and no existing databases).

Thanks

I believe the expected behavior is to read up the sidecar file and update it. Different versions of the application have different xmp formats.

To not break anything. I’ll have a look. There were some changes to remove unneeded masks, but I never saw duplicated masks.

This should be fixed now. Thanks for reporting.

JFYI: our 2.4.x snapshots for linux already have the fix.

Thanks so much for finding and fixing this!

I really appreciate how much effort you put into this software.

Inchoate

Are these changes available in a PPA?
Or do I need to build darktable myself?

I’m kind of stuck without a fix. I get hundreds of corrupted images when I import my library.

you probably want the graphics:darktable:stable package.

I just installed darktable from the graphics:darktable:stable as mentioned above, and I’m still seeing the same problem.
I have an image I had previously edited with 3 spot removal fields. When I import this image into darktable, the xmp file ends up with 3 copies of the darktable:mask_... variable data. For example, the darktable:mask_name list looks like this:

<darktable:mask_name>
    <rdf:Seq>
     <rdf:li>path #1</rdf:li>
     <rdf:li>path #3</rdf:li>
     <rdf:li>path #4</rdf:li>
     <rdf:li>grp spot removal</rdf:li>
     <rdf:li>path #1</rdf:li>
     <rdf:li>path #3</rdf:li>
     <rdf:li>path #4</rdf:li>
     <rdf:li>grp spot removal</rdf:li>
     <rdf:li>path #1</rdf:li>
     <rdf:li>path #3</rdf:li>
     <rdf:li>path #4</rdf:li>
     <rdf:li>grp spot removal</rdf:li>
    </rdf:Seq>
   </darktable:mask_name>

The other mask related tables show the same thing. Something is weird. Is my original xmp file corrupted in some way?

Can you try the snapshot release?

that is the stable branch snapshot

Ok, I’ve installed darktable from the snapshot release: darktable 2.5.0~git389.2c4d40683.

I’m still seeing a number of seriously modified files. The worst are the ones where all of the darktable:history entries are deleted!

I have a moderate sized library of perhaps 50k images. I started with an empty darktable database (having removed all images) and then imported my files. I then ran diffs on the xmp files against my backup copies and examined the differences for a portion of them.

For the subset that I looked at, there were about 5000 total images with about 130 of them showing some differences. Out of those differences, about 25 were what I would consider to be ‘corrupted’, since they lost all of my image editng history.
Most of the other diffs seemed to be re-ordering of the <darktable:mask_… > lists (associated mostly with spot removal edits). I’m assuming that these changes are probably not significant, although I could be wrong.

I have been using darktable for many years now, having upgraded to new versions as they come along. It’s possible that my photo library has accumulated corruption from earlier darktable bugs.

I really appreciate your help! Any suggestions as to what to try?

Thanks

Please share one XMP before and after darktable corrupted it.

Sure. Here is Before.ORF.xmp and After.ORF.xmp.

After.ORF.xmp (2.18 KB)

Before.ORF.xmp (8.03 KB)

Here is the raw Olympus file that goes along with the XMP’s I posted.

Can someone try importing the Before.ORF.xmp to see if they see a similar loss of edits?OLYF3482.ORF (18.7 MB)

Lost all edits inside the XMP, not on the import. Before.ORF.xmp seems fine

Before:
Captura%20de%20pantalla%20de%202018-07-02%2018-46-49
After:
Captura%20de%20pantalla%20de%202018-07-02%2018-47-02

are you using other software like digikam with those directories? I had digikam overwriting XMP files e.g.

That xmp loads fine for me.

If you can reproduce the deletion of the history when importing an image with that sidecar, could you please do so while running darktable in a terminal so you can see error messages printed there?

The strange thing is that I can re-import the ‘damaged’ images again manually with out problem! All of my edits survive correctly.

What happened initially was that I had done fresh install of Kubuntu on my computer along with the latest darktable (at the time; 2.4.4 I think). Since I had backed up my entire image library just before the OS update, after installing the OS, I simply opened up darktable and proceeded to import all of my photos.

Once the import was complete (it took a long time since I didn’t have OpenGL setup) I ran diffs between my xmp files and their backups. That’s when I discovered a large number of changes had been made.

I’m certain that I did not run any other photo application that might have messed up the xmp files.

At this point, I’m working on a script to identify the damaged files so I can re-import them again. I’ve re-imported about a dozen successfully so far, but I need to speed up the process.

If you reset your settings in darktable, then you were missing the “look for updated xmp” option in the preferences.