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, 15:39
Post: #2
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: #3
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
  while in text tool and typing, gimp gumps to paths tool skassoum@gmail.com 1 93 Jan 26, 2018 13:14
Last Post: paynekj
  Stopping gimp from colouring the transparent background vizzkidd 2 116 Jan 22, 2018 18:53
Last Post: vizzkidd
  Gimp Tool Box and Tool Options Remain on Desktop Jerrod 3 150 Jan 7, 2018 14:25
Last Post: my nellie
  GIMP not seeing new folders VolleyChick 1 108 Jan 1, 2018 07:11
Last Post: ythgilb
  Gimp mouse wheel zoom resolution scorr14 1 135 Dec 21, 2017 06:11
Last Post: ythgilb

Forum Jump:


GIMP ForumPortalArchiveContactTermsRSS