RSS/Atom feed Twitter
Site is read-only, email is disabled

script to delete layer

This discussion is connected to the gimp-user-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

1 of 1 message available
Toggle history

Please log in to manage your subscriptions.

script to delete layer free 22 Sep 13:36
free
2012-09-22 13:36:51 UTC (about 12 years ago)

script to delete layer

Hello to all! Again I am stuck with a problem with python script. I want to delete a layer, not only remove it from the image. The reason I want to do that is because while the script I did is running gimp increasily takes more and more memory, until a point that the script stops because there is no RAM left. My script duplicates layers, put them in the image, duplicate the image, exports and them removes the duplicated layers and image from it. But it seems that only removing the layers is not enough to liberate memory. Any help would be appreciated...

the pdb.gimp_item_delete function takes an item as parameter. So here is, more or less, what I am doing:

layer_to_be_deleted = gimp.Item.from_id(layer_id) pdb.gimp_item_delete(layer_to_be_deleted)

This script cause this error:

Traceback (most recent call last): File "", line 1, in
RuntimeError: execution error

I don't know what is going on. I am running gimp on a windows xp x64 sp2.

In the documentation, it says that the item can not be in the image when the function is called. But if I remove it from the image and then try to delete it, I get this error:

Calling error for procedure 'gimp-item-delete': Procedure 'gimp-item-delete' has been called with value '25' for argument 'item' (#1, type GimpItemID). This value is out of range.

wich is expected, because the layer_to_be_deleted layer is not an Item anymore. It changes to a null, I think.

Well, if someone have some other tip on how can I make the script stop taking all the RAM memory of my machine, it would be very appreciated :)

-- Thiago