Bug 283610 - Krita doesn't save clone layers correctly
Summary: Krita doesn't save clone layers correctly
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: File formats (show other bugs)
Version: git master (please specify the git hash!)
Platform: Gentoo Packages Linux
: NOR critical
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-08 15:58 UTC by Torio Mlshi
Modified: 2011-10-17 20:42 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
This is a bugfixing patch (10.05 KB, patch)
2011-10-16 13:08 UTC, Torio Mlshi
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Torio Mlshi 2011-10-08 15:58:08 UTC
Version:           svn trunk (using KDE 4.7.1) 
OS:                Linux

Clone layers are saved referencing their targets by names, so when there are two (or more) layers with the same name, clone layers are not saved correctly.

I can see two ways of solving this:

1. Warn user when (or even doing so) layers with same name appear.

2. Change saving clone layers. For example save not name of target, but its filename (which appear to be unique).

Reproducible: Always

Steps to Reproduce:
1. Create two layers with the same name.
2. Create clone layers to each of them.
3. Save file.
4. Open it again.

Actual Results:  
Both clone layers are pointing to one layer.

Expected Results:  
Clone layers should work as before saving/opening: point to different layers.
Comment 1 Halla Rempt 2011-10-15 09:18:09 UTC
I can confirm, and this is a critical bug, since it leads to dataloss. Torio -- didn't you already have a patch for this bug?
Comment 2 Torio Mlshi 2011-10-16 13:08:17 UTC
Created attachment 64584 [details]
This is a bugfixing patch

2boud:

Yes, I've just finished it today ;) It is implemented not with filenames (as they are not constant and generated each time on saving), but with new field - uuid.

Bug seems to be fixed in this commit, but I think that krita/dtd/krita.dtd should also be fixed to represent changes. So I wonder if uuid should be marked as required or impiled (for compatibility reasons)?
Comment 3 Halla Rempt 2011-10-16 13:21:40 UTC
Interesting patch... Can you put it on git.reviewboard.kde.org to make it easy for everyone else to look at it as well. I think I agree with using uuid's here instead of layernames. I'm not sure it needs a change to the dtd, but we carefully need to make sure old versions of krita can load files created this way and vice versa.