It is currently Thu Jul 04, 2024 2:30 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Display_delete & Image_delete
PostPosted: Sun Feb 14, 2021 5:11 pm  (#1) 
Offline
GimpChat Member

Joined: Feb 07, 2019
Posts: 8
Hello

It can't be that much difficult !

Where can i find tutorial about that part ?

Thanks

Fransua


Share on Facebook Share on Twitter Share on Orkut Share on Digg Share on MySpace Share on Delicious Share on Technorati
Top
 Post subject: Re: Display_delete & Image_delete
PostPosted: Mon Feb 15, 2021 5:34 am  (#2) 
Offline
GimpChat Member
User avatar

Joined: Apr 15, 2017
Posts: 1826
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.


Top
 Post subject: Re: Display_delete & Image_delete
PostPosted: Mon Feb 15, 2021 5:46 am  (#3) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4756
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.

_________________
Image


Top
 Post subject: Re: Display_delete & Image_delete
PostPosted: Mon Feb 15, 2021 8:04 am  (#4) 
Offline
GimpChat Member

Joined: Feb 07, 2019
Posts: 8
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)


Top
 Post subject: Re: Display_delete & Image_delete
PostPosted: Mon Feb 15, 2021 8:13 am  (#5) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4756
"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".

_________________
Image


Top
 Post subject: Re: Display_delete & Image_delete
PostPosted: Mon Feb 15, 2021 8:32 am  (#6) 
Offline
GimpChat Member

Joined: Feb 07, 2019
Posts: 8
Thanks Ofnuts.
Is there a way to get the display from image.id ?


Top
 Post subject: Re: Display_delete & Image_delete
PostPosted: Tue Feb 16, 2021 10:53 am  (#7) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4756
Which display, since an image can have several displays... But in the API, no way to tell which display belongs to which image.

_________________
Image


Top
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts How to delete account

2

No new posts Attachment(s) [SOLVED] Delete large part of path?

4

No new posts Attachment(s) How to get the Display from a new image created with Gmic ?

5

No new posts Corrupted display on custom platform

3


cron

* Login  



Powered by phpBB3 © phpBB Group