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

how / when to use gimp-image-delete

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.

3 of 3 messages available
Toggle history

Please log in to manage your subscriptions.

how / when to use gimp-image-delete Gary Aitken 19 Sep 10:05
  how / when to use gimp-image-delete paynekj 19 Sep 10:19
   how / when to use gimp-image-delete Gary Aitken 19 Sep 22:58
Gary Aitken
2012-09-19 10:05:17 UTC (over 11 years ago)

how / when to use gimp-image-delete

When processing a series of files in script-fu, I'm trying to do the following:

for each file name: Create an image by reading it in.
(set! orgImg (car (file-ufraw-load ... Create another image by duplicating the input image and manipulating it. (set! newImg (car (gimp-image-duplicate orgImg))) (gimp-image-scale newImg wid ht) (plug-in-unsharp-mask RUN-NONINTERACTIVE newImg newImg ... Write the new image out.
(file-jpeg-save ... newImg ...
Since I'm done with the newly created image, I did a (gimp-image-delete newImg)

Continuing on, if I try to re-use that variable to create another image from the original image
and try to manipulate it, I get an error after a bit:

(set! newImg (car (gimp-image-duplicate orgImg))) ; doesn't complain (gimp-image-scale newImg wid ht) ; doesn't complain (plug-in-unsharp-mask RUN-NONINTERACTIVE newImg newImg ... Error: Procedure execution of plug-in-unsharp-mask failed on invalid input arguments: Procedure 'plug-in-unsharp-mask' has been called with an invalid ID for argument 'drawable'. Most likely a plug-in is trying to work on a layer that doesn't exist any longer.

If I comment out the gimp-image-delete
it works fine.

Can someone explain to me what is going on? (Using gimp 2.6)

Thanks,

Gary

2012-09-19 10:19:09 UTC (over 11 years ago)
postings
16

how / when to use gimp-image-delete

According to the procedure browser, the third parameter to pass to the plug-in-unsharp-mask should be the drawable id, but you are passing the image id. It's only working in your first stage because, by luck, the image id and the drawable id have the same value.

You need to get a drawable id - usually by calling gimp-image-get-active-layer

Gary Aitken
2012-09-19 22:58:46 UTC (over 11 years ago)

how / when to use gimp-image-delete

On 09/19/12 04:19, paynekj wrote:

According to the procedure browser, the third parameter to pass to the plug-in-unsharp-mask should be the drawable id, but you are passing the image id.
It's only working in your first stage because, by luck, the image id and the drawable id have the same value.

You need to get a drawable id - usually by calling gimp-image-get-active-layer

Thanks; (also for the pointer on variable number of args)

When I do gimp-image-get-active-layer, I get something, not a number, back; and that something is not directly usable in a call to plug-in-unsharp-mask. After much hair tearing, I discovered you have to take the car of it.

What's the best way to determine / print out what a thing is? This is where the old form, "print" seems to be more useful than "display" as it seems to print out whatever the arg is; it doesn't have to be converted to string, which is tough if you don't know what it is to begin with. Is there a "more correct" way?

Thanks,

Gary