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 337557 - add a toggle to merge_visible_layers to discard non-visible layers
add a toggle to merge_visible_layers to discard non-visible layers
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: User Interface
git master
Other Linux
: Normal enhancement
: 2.4
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2006-04-06 22:56 UTC by Carol
Modified: 2006-04-07 08:01 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
python script to merge-visible-layers and discard not visible layers (1.04 KB, text/x-python)
2006-04-06 22:58 UTC, Carol
Details

Description Carol 2006-04-06 22:56:04 UTC
In my quest to avoid the export dialog, I wrote a python script that offers the same functionality that merge_visible_layers does but also removes the non-visible layers.

The script only uses one pdb call, which I thought was really cool and perhaps meant that it would be easy to add a toggle to the existing merge_visible_layers dialog that would allow discarding the non-visible layers.  The one pdb call makes the script really work as a one step before saving as a transparent png.

Here is the relevant portion of the script:

    for layer in image.layers:
        if not layer.visible:
            image.remove_layer(layer)
    
    final_layer = image.merge_visible_layers(merge_type)
    if merge_type == EXPAND_AS_NECESSARY:
        pdb.gimp_image_resize_to_layers(image)

I will attach the script in case anyone wants to try it.
Comment 1 Carol 2006-04-06 22:58:09 UTC
Created attachment 62885 [details]
python script to merge-visible-layers and discard not visible layers
Comment 2 Sven Neumann 2006-04-07 08:01:12 UTC
2006-04-07  Sven Neumann  <sven@gimp.org>

	* app/core/gimpimage-merge.[ch] (gimp_image_merge_visible_layers):
	allow to discard invisible layers as suggested in bug #337557.

	* app/actions/image-commands.c
	* app/dialogs/image-merge-layers-dialog.[ch]: added a check button
	to the Merge Visible Layers dialog to control the new feature.

	* app/file/file-open.c
	* tools/pdbgen/pdb/image.pdb: pass FALSE for the new parameter.

	* app/pdb/image_cmds.c: regenerated.