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

Guillotine batch script

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.

1 of 1 message available
Toggle history

Please log in to manage your subscriptions.

Guillotine batch script Taxman 11 Feb 04:56
Taxman
2009-02-11 04:56:47 UTC (almost 16 years ago)

Guillotine batch script

Hello I've searched far and wide and seen some questions on this, but no answers I could make use of. One link here: http://groups.google.tt/group/comp.graphics.apps.gimp/browse_thread/thread/f46cc17a1874caea has an answer that I don't know enough scheme to make use of.

Basically I want to input based on a file glob a filename such as 0001.jpg, add a vertical guide at a certain percentage, say 50%, and then guillotine it and save the resulting images as 0001a.jpg and 0001b.jpg

I started with the http://www.gimp.org/tutorials/Basic_Batch/ basic batch tutorial and tried to modify it for my needs, but without knowing scheme and not being able to figure out enough I didn't know how to assign the right image and drawable and save the resulting parts to the filenames I want.

Here is what I tried:

(define (batch-guillotine pattern direction percent) (let* ((filelist (cadr (file-glob pattern 1)))) (while (not (null? filelist))
(let* ((filename (car filelist)) (image (car (gimp-file-load RUN-NONINTERACTIVE filename filename))) (drawable (car (gimp-image-get-active-layer image)))) (script-fu-guide-new-percent 0 image drawable direction percent) (plug-in-guillotine 0 image drawable) (gimp-file-save RUN-NONINTERACTIVE image drawable filename filename) (gimp-image-delete image)) (set! filelist (cdr filelist)))))

Can anyone finish it for me? I have gotten other single plugins to work in batch mode like this calling something like $ gimp -i -b '(batch-guillotine "*.jpeg" 1 50)' -b '(gimp-quit 0)' , but nothing so complex as this one. I'm running Gimp 2.6.1 on Ubuntu 8.10 so if someone wrote a python script instead to do the same thing I could figure out how to run that if someone pointed me to the docs. Thanks

Taxman