Post Reply 

I need help with Gimp Batch file Processing

Sep 20, 2011, 05:29 (This post was last modified: Sep 20, 2011 05:36 by ThWatcher.)
Post: #1
I need help with Gimp Batch file Processing
Hello and thanks for any help anyone can give me.
I'm obviously doing something wrong because so many other sites publish scripts very similar to this one. So, please feel free to point out exactly where I messed up. I'll accept it gladly if it will lead me to learning from my error.

I'm trying to set up some batch processing in Gimp for a few thousand image files.

I'm "working on / trying this" with 2 PC systems, a Vista PC and a Windows 7 PC.

The images are in: <E:\My Pics\Ricks Fantasy Photography\tmp>
My batch file is in the same folder as the images and contains:
-----------------------------
"C:\Program Files (x86)\GIMP-2.0\bin\gimp-2.6.exe" -i -b (batch-auto-fix "GED*.JPG") -b '(gimp-quit 0)'
-----------------------------


My Gimp script file is in the folder: <C:\Users\Nail\.gimp-2.6\scripts>
So far, it contains:
-----------------------------
(define (batch-auto-fix pattern)
(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))))
(plug-in-unsharp-mask RUN-NONINTERACTIVE
image drawable radius amount threshold)
(gimp-levels-stretch drawable)
(plug-in-color-enhance RUN-NONINTERACTIVE
image drawable)
(gimp-file-save RUN-NONINTERACTIVE
image drawable filename filename)
(gimp-image-delete image))
(set! filelist (cdr filelist)))))
-----------------------------



I open up a command prompt window and change to the folder with the images and batch file.
I execute the batch file.
It opens a prompt window for Gimp labeled: (GIMP output. You can minimize this window but don't close it.)

Inside this window, I get:
-----------------------------
GIMP-Error: Opening 'E:\My Pics\Ricks Fantasy Photography\tmp\GED*.JPG)' failed: Invalid argument

GIMP-Error: Opening 'E:\My Pics\Ricks Fantasy Photography\tmp\0)'' failed: No such file or directory

batch command executed successfully
batch command executed successfully
-----------------------------
Find all posts by this user
Quote this message in a reply
Sep 20, 2011, 07:43 (This post was last modified: Sep 20, 2011 07:51 by paynekj.)
Post: #2
RE: I need help with Gimp Batch file Processing
I've not looked at your script code, but I can see your command line is wrong for use on Windows. Single quotes ' don't behave the same way on Windows as they do in Linux

Try:

"C:\Program Files (x86)\GIMP-2.0\bin\gimp-2.6.exe" -i -b "(batch-auto-fix \"GED*.JPG\")" -b "(gimp-quit 0)"


Having had a quick look at the code you have a problem with this line:
Code:
(plug-in-unsharp-mask RUN-NONINTERACTIVE image drawable radius amount threshold)
You are using variables radius, amount and threshold that haven't been defined anywhere.
Find all posts by this user
Quote this message in a reply
Sep 20, 2011, 15:39
Post: #3
RE: I need help with Gimp Batch file Processing
The quotes were it. I knew it was something simple.
I just needed the eyes of someone with the knowledge.

Thank you Very Much.
Find all posts by this user
Quote this message in a reply
Jun 26, 2012, 21:46
Post: #4
RE: I need help with Gimp Batch file Processing
I just found this page to perform my own windows batch process. I modified the posted code for my own written script. The script works beautifully in the UI, but the batch command experiences an "execution error"

Do I need to place my script in the default folder for it to work? I would think it would be enough for me to include my script folder in the folder options section. I have tried it both ways with the same result.

Can anyone point me in the right direction?

Here is the code I am using in my batch script:


(define

(batch-cr-anaglyph pattern)

;Get File List from Glob String
(let*
(
(filelist (cadr (file-glob pattern 1)))
)


(while
(not (null? filelist))

(let*

(
(filename (car filelist))
(image (car (gimp-file-load RUN- NONINTERACTIVE
filename filename)))
)

(script-fu-cr-anaglyph-batch image)
(set! drawable (car (gimp-image-get-active-layer image)))

;Save File

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

);end let

);end while

);end let

);end define
Find all posts by this user
Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Gimp prints multi page documents on one page samksharma 1 51 Oct 17, 2017 04:49
Last Post: paynekj
  Recently Used File List foberle 1 48 Oct 14, 2017 13:55
Last Post: ythgilb
  How to make a small book in GIMP? Dimensions? Youwotm8 1 89 Sep 26, 2017 06:34
Last Post: ythgilb
  GIMP - “windows 10” - “command line” - error alvaro562003 4 192 Sep 18, 2017 08:13
Last Post: paynekj
Tongue Installing GIMP User Manual ozdoug 2 197 Aug 9, 2017 00:54
Last Post: ozdoug

Forum Jump:


GIMP ForumPortalArchiveContactTermsRSS