I've got a situation where I need to make a minute correction to several hundred images.
The process of doing this by hand is incredibly time consuming, so I've been trying to look into some method of batch processing in order to handle this efficiently. I've never done this before, admittedly, but I spent a lot of time reading the tutorials here on Gimp.org and in the Procedure Browser trying to figure out how to do this via the command line.
I've run into a wall of "batch command experienced an execution error" crapouts and I've spent most of today trying to figure out where the code is breaking down and why. That's proven to be futile for me, because it seems like the code breaks in different ways depending on what's commented out and not ...
This is what my code currently looks like, with comments.
(define (batch-rw-resizer pattern)
(filelist (cadr (file-glob pattern 1))))
(while (not (null? filelist))
(filename (car filelist))
(image (car (gimp-file-load RUN-NONINTERACTIVE filename filename)))
(drawable (car (gimp-image-get-active-layer image))))
; Making a new layer out of the image.
(gimp-layer-new-from-drawable drawable image)
; Adding the layer to the image.
(gimp-image-add-layer image new-layer 0)
; Naming new layer.
(gimp-layer-set-name new-layer "Comic")
; Selecting the top part of the image.
(gimp-rect-select image 0 0 459 163 REPLACE 0 0)
; Cutting out the top part of the image.
; Moving the remainder of the image down two pixels.
(gimp-layer-translate drawable 0 -2)
; Resizing entire image to fit the shifted layer
; Re-pasting the selection from the top
(gimp-edit-paste image drawable 1)
; Flattening the image.
; Saving the file.
(gimp-file-save RUN-NONINTERACTIVE image drawable filename filename)
(set! filelist (cdr filelist))))
; End script
Hopefully the commented lines can help give you guys an idea of what I was meaning to do with each command; I am at a loss at what needs to be done for Gimp to properly process this batch script.