After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 386199 - 'Open as Layers...' add layers in reverse order
'Open as Layers...' add layers in reverse order
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: General
git master
Other All
: Normal normal
: 2.4
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2006-12-15 13:58 UTC by Aurore D
Modified: 2006-12-15 15:35 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Aurore D 2006-12-15 13:58:40 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.
Comment 1 Sven Neumann 2006-12-15 14:58:12 UTC
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;
Comment 2 Aurore D 2006-12-15 15:15:43 UTC
You are right. I applied the suggested changes and it seems to work fine. 
Comment 3 Michael Natterer 2006-12-15 15:35:34 UTC
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.