GNOME Bugzilla – Bug 386199
'Open as Layers...' add layers in reverse order
Last modified: 2006-12-15 15:35:34 UTC
If you want to add a multi-layers XCF file to an image, its layers appear in the reverse order. Steps to reproduce : 1. Create an image with at least 2 layers, and save it as an XCF file. 2. Create a new image (or open an existing one). 3. On that new image, click on 'File > Open as Layers...' and choose the XCF file previously saved (or drag and drop that XFC file from a file browser to the new image) Actual results: The layers loaded from the xcf are in reverse order, the background one being the top one, etc. Expected results: Loaded layers in the same order as in the file they came from.
I don't have the time to check this right now, but most probably the following change needs to be done: --- app/file/file-open.c 11 Dec 2006 18:39:12 -0000 1.98 +++ app/file/file-open.c 15 Dec 2006 14:57:27 -0000 @@ -453,7 +453,7 @@ file_open_layers (Gimp *g g_object_unref (new_image); } - return g_list_reverse (layers); + return layers;
You are right. I applied the suggested changes and it seems to work fine.
The g_list_reverse() in above function is correct. gimp_image_add_layers() needed to be fixed: 2006-12-15 Michael Natterer <mitch@gimp.org> * app/core/gimpimage.c (gimp_image_add_layers): fixed order of layers for the position == -1 (add above avtive layer) case. Fixes bug #386199.