• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

GIMP 2.6.7 Help! - batch script

Noid

Platinum Member
Search not working on new forum. Please forgive my request for help, if topic is already posted.

I found a script on the net here that is supposed to crop multiple images in batch mode using GIMP. I would like get it working. There are a couple of things I already fixed in the batch file, but I can't get the script to execute.

( 1.)
This is my "batch-crop.bat" file and it's located in the same directory with my images to be cropped. My system path has been modified to find GIMP no matter where a script is run.

gimp-2.6 -i -b "(batch-crop "*.jpg" )" -b "(gimp-quit 0)"

Notice I added the "-b" to the gimp-quit command to get the original script to close the "GIMP output" console properly.

(2.)
The script is located in my default GIMP script directory :
C:\Documents and Settings\Administrator\.gimp-2.6\scripts --- called batch-crop.scm

(define (batch-crop pattern)
(let* ((filelist (cadr (file-glob pattern 1))))
(while (not (null? filelist))
(let* ((filename (car filelist))
(image (car (gimp-file-load 1 filename filename)))
(drawable (car (gimp-image-get-active-layer image))))

(gimp-image-crop image 20 40 0 0)

(gimp-file-save 1 image drawable filename filename)
(gimp-image-delete image))
(set! filelist (cdr filelist)))))

I changed the use of "RUN-NONINTERACTIVE" to "1" according to the parameter descriptions on the functions within GIMP in an attempt to get the script to execute.

I receive this message within the GIMP output window during execution:

"batch command experienced an execution error"

I sent an Email to the author at the website, but I received no reply.
I think I followed the proper placement of files and code corrections, but I have run out of places to find help on the net. GIMP recently updated it's help for 2.6 recently, but it has no help in debugging my problem.

I think the list creation (file-glob) is not working properly. I was hoping to get a "image" name to output for debugging. But had no luck either.

Any GIMP guru out there ?

TIA
 
gimp-2.6 -i -b "(batch-crop \"*.jpg\" )" -b "(gimp-quit 0)"

My problem existed in my batch file command line.
Notice the \" delimiter for the file parameter expression.

Thanks to author ( link in original post ) who gave his time and advice to resolve my issue .
 
Maybe you really need to upgrade now on the latest GIMP version.
Current version I'm using is 3.6
 
Back
Top