Post Reply 

Referencing multiple images open in Gimp

Jun 4, 2012, 10:44 (This post was last modified: Jun 4, 2012 11:00 by bippered.)
Post: #1
Referencing multiple images open in Gimp
Hello,

I have written a couple of *python* scripts which operate on images which are already open. They resize, and save images (including thumbnails) and append simple html code to a file when I press a hotkey.

I want to be able to batch process all open images, without having to save them first or use the Gimp batch processor. Is it possible to do this ? - I have read that it may not be possible to reference specific individual open files, but can I make a simple loop for the already open images using some form of : image = gimp.image_list()[0].

I know this is simple, but I want to know if it is possible before I attempt it Smile

Thanks.
Find all posts by this user
Quote this message in a reply
Jun 4, 2012, 16:03
Post: #2
RE: Referencing multiple images open in Gimp
I just wanted to know if It could be done, before I tried the impossible Smile

I managed to do it by calling the original processing script (called 'eBay_Multi_Image') using the following :

Code:
def BatchTable(timg, tdrawable):
        images = gimp.image_list()
        imageno = len(images)
        x = 0
        while (x < imageno):
              
              currimg = images[x]
                            
              currdrawable = pdb.gimp_image_get_active_drawable(currimg)
                            
              pdb.python_fu_eBay_Multi_Image(currimg, currdrawable)
              
              x = x + 1

Probably not the nicest bit of code Smile - but it did the job.
Find all posts by this user
Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  how to lock the guides in GIMP sureshsaragadam 1 167 Feb 7, 2019 12:23
Last Post: paynekj
  edit psd file programmaticaly without open editor fabricia77 1 639 Dec 5, 2018 11:16
Last Post: paynekj
  edit psd file programmaticaly without open editor fabricia77 1 582 Dec 5, 2018 10:50
Last Post: paynekj
  PDN Plug-in for GIMP? snoopy55 11 12,185 Dec 3, 2018 09:16
Last Post: paynekj
  Script Fu Errors Gimp 2.10.4 lightsaber jd3481 1 947 Aug 2, 2018 05:13
Last Post: paynekj

Forum Jump:


GIMP ForumPortalArchiveContactTermsRSS