GIMP Chat
http://gimpchat.com/

Display_delete & Image_delete
http://gimpchat.com/viewtopic.php?f=9&t=19163
Page 1 of 1

Author:  fransua [ Sun Feb 14, 2021 5:11 pm ]
Post subject:  Display_delete & Image_delete

Hello

It can't be that much difficult !

Where can i find tutorial about that part ?

Thanks

Fransua

Author:  racer-x [ Mon Feb 15, 2021 5:34 am ]
Post subject:  Re: Display_delete & Image_delete

fransua wrote:
Hello

It can't be that much difficult !

Where can i find tutorial about that part ?

Thanks

Fransua


It can't be that much difficult to actually explain what your question is, now can it? Unfortunately my crystal ball doesn't work.

Author:  ofnuts [ Mon Feb 15, 2021 5:46 am ]
Post subject:  Re: Display_delete & Image_delete

fransua wrote:
Hello

It can't be that much difficult !

Where can i find tutorial about that part ?

Thanks

Fransua


Tried the "Browse" button in the Python-fu/Script-fu console? They lead to the doc of the whole API.

Author:  fransua [ Mon Feb 15, 2021 8:04 am ]
Post subject:  Re: Display_delete & Image_delete

Thanks Guys. What an active forum !

My pb : I have created an image from a gmic filter which comes like : [<gimp.Image '[Sans titre]'>,

The image is displayed correctly.
Now I want delete it after saving it.
This is where I bug ! (last 2 lines)

pdb.gimp_message(gimp.image_list())
active_Image=gimp.image_list()[0]
active_layer = pdb.gimp_image_get_active_layer(active_Image)
#reverse layer
pdb.script_fu_reverse_layers(active_Image, active_layer)
# save the file to a new filename
out_filename=out_directory+filename+command[i]+".jpg"
pdb.gimp_file_save(active_Image, active_layer, out_filename, out_filename)

pdb.gimp_display_delete(active_Image)
pdb.gimp_image_delete(active_Image)

Author:  ofnuts [ Mon Feb 15, 2021 8:13 am ]
Post subject:  Re: Display_delete & Image_delete

"active_Image=gimp.image_list()[0]": likely not unless you have only one image. The image to which your plugin/script applies is passed as an input parameter if you do the registration with the proper parameter description. Otherwise, if GMIC returns an image, then use the returned image. The parameter to "display_delete()" is a display, not an image(*). Normally a script/plugin can only delete displays that itcreated, and you get the display id when you create it. By design you aren't supposed to be able to delete a display that you didn't create (there are ways around this but really you shouldn't need them).

(*) An image can have several displays, from the user's perspective this is "View>New view".

Author:  fransua [ Mon Feb 15, 2021 8:32 am ]
Post subject:  Re: Display_delete & Image_delete

Thanks Ofnuts.
Is there a way to get the display from image.id ?

Author:  ofnuts [ Tue Feb 16, 2021 10:53 am ]
Post subject:  Re: Display_delete & Image_delete

Which display, since an image can have several displays... But in the API, no way to tell which display belongs to which image.

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/