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

PDB access to tools

This discussion is connected to the gimp-developer-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.

2 of 2 messages available
Toggle history

Please log in to manage your subscriptions.

PDB access to tools Jon Niehof 28 Oct 05:16
  PDB access to tools michael chang 30 Oct 01:04
Jon Niehof
2005-10-28 05:16:05 UTC (over 18 years ago)

PDB access to tools

Haven't found anything recent in the archives regarding this--is it possible to access the toolbox in some way via scheme scripts? I want to batch-crop a bunch of images--i.e. write a script that'll load an image, display it, pull up the crop tool, and wait for the user to approve the crop. Then, once the crop is done, save the image, close the window, go to the next one.

__________________________________
Start your day with Yahoo! - Make it your home page! http://www.yahoo.com/r/hs

michael chang
2005-10-30 01:04:31 UTC (over 18 years ago)

PDB access to tools

On 10/27/05, Jon Niehof wrote:

Haven't found anything recent in the archives regarding this--is it possible to access the toolbox in some way via scheme scripts? I want to batch-crop a bunch of images--i.e. write a script that'll load an image, display it, pull up the crop tool, and wait for the user to approve the crop. Then, once the crop is done, save the image, close the window, go to the next one.

IIRC, The tools simply provide a gui interface to simplified pdb functions that can be called directly in scripts, such as gimp_image_crop. Also, IIRC, there isn't really a good way of prompting the user for confirmation with that kind of instance in script functions. In addition, loading multiple images looks like either you're using GLOB or having them "hard-coded" (*shivers in ugliness*). Finally, it is worth noting that there is an autocrop option in one of the image menus (and PDB has plug_in_autocrop and plug_in_autocrop_layer).

In my experinece, unless you're processing, say, 500+ images, it looks like it'd be more work to get a script to simply open, show, and close those images, let alone do anything with them, especially in Scheme/Script-fu, than to do it by hand. (Once it *is* done, however, it is nice to have, I'm sure.)

One "tool" that may be of help if you do proceed with this - in GIMP, there is a "Procedure browser" in the Xtns menu in 2.2.8 and 2.3.4 (probably in various others; has this moved yet in CVS?), sometimes you can search for the action you want to do (e.g. crop) and you'll get a list of script-fu/pdb procedures, which parameter lists. (Avoid ones marked deprecated!) Note that, IIRC, script-fu seperates words with the - (dash) not the _ (underscore) last I checked, although the PDB shows it the other way around.

Please note that there may be errors in my answer, if so, someone else may be able to correct them. Take my response with caution.

-- ~Mike
- Just my two cents
- No man is an island, and no man is unable.