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 358082 - "Open as layer" loads garbage when opening an animated gif
"Open as layer" loads garbage when opening an animated gif
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: User Interface
git master
Other All
: Normal normal
: 2.4
Assigned To: GIMP Bugs
GIMP Bugs
: 480225 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2006-09-28 03:33 UTC by Tuomas Kuosmanen
Modified: 2007-09-25 14:18 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Tuomas Kuosmanen 2006-09-28 03:33:22 UTC
Please describe the problem:
Attempting to open an animated gif as layer loads a layer full of garbage data

Steps to reproduce:
1. Open an image or create a new one
2. Select File -> Open as layer
3. Select an animated gif image to load


Actual results:
The animated gif opens as one layer, and it appears Gimp is expecting just one, thus it produces one layer of garbage data.

Expected results:
I would expect the complete animated gif to open as a pile of new layers.

Does this happen every time?
yep

Other information:
Comment 1 Sven Neumann 2006-09-28 07:11:55 UTC
Open as Layer merges all layers in the file that it opens. That is probably the garbage you are seeing.

We might want to add a dialog that asks the user what to do. Or we might just want to change the default behaviour.
Comment 2 Tuomas Kuosmanen 2006-10-06 12:31:19 UTC
Ok, that explains it. 

I first thought a confirmation dialog would be needed to decide whether to load as flattened or layers, but the more I think about this, the more I seem to think it  should just load the file as multiple layers - it is always possible to load one separately, flatten (or merge visible) and then add the resulting single layer to the image. 

Or is it possible to add a "[x] Preserve layers" in the "open-as-layer" -file dialog? 

I think that might solve it nicely, although the drag and drop -thing would then be different. Could the DND operation be somehow modifier-selectable whether it should preserve layers or not?
Comment 3 Sven Neumann 2006-10-16 13:02:31 UTC
Let's change this in one way or another for 2.4.
Comment 4 Sven Neumann 2006-10-31 14:34:37 UTC
Our internal function file_open_layer() returns a layer and this function is exported to the PDB. So it might become a little tricky to change this behaviour.
Comment 5 Michael Natterer 2006-10-31 14:50:25 UTC
Coincidentially, i hacked this last night so file_open_layer() is now
file_open_layers() and returns a GList. It works perfectly, I just
have no idea yet how to present the new "gboolean merge_visible"
parameter to the user interface or what to do with the PDB api.

In my tree, all GUI use defaults to merge_visible = FALSE, and the
PDB wrapper user merge_visible = TRUE and returns a single layer.
Comment 6 Sven Neumann 2006-10-31 15:10:33 UTC
Do we need to expose this in the UI at all? We could simply default to TRUE and perhaps add a PDB wrapper called file-open-layers which defaults to TRUE and returns an array of layer IDs.
Comment 7 Michael Natterer 2006-11-03 17:13:10 UTC
Fixed in CVS:

2006-11-03  Michael Natterer  <mitch@gimp.org>

	* app/core/core-enums.[ch] (enum GimpUndoType): added value
	GIMP_UNDO_GROUP_LAYER_ADD.

	* app/file/file-open.[ch]: changed file_open_layer() to
	file_open_layers(), added parameter "gboolean merge_visible",
	return a GList of layers.

	* app/dialogs/file-open-dialog.c
	* app/display/gimpdisplayshell-dnd.c
	* app/widgets/gimplayertreeview.c: pass merge_visible = FALSE and
	add all returned layers to the image. Fixes bug #358082.
	(contains lots of duplicated code, will factor that out later).

	* tools/pdbgen/pdb/fileops.pdb (load_layer): pass merge_visible = TRUE
	(load_layers): new wrapper which returns all the image's layers.

	* app/pdb/fileops_cmds.c
	* app/pdb/internal_procs.c
	* libgimp/gimpfileops_pdb.[ch]: regenerated.

	* libgimp/gimp.def: changed accordingly.
Comment 8 Sven Neumann 2007-09-25 14:18:17 UTC
*** Bug 480225 has been marked as a duplicate of this bug. ***