# Deskew script execution error

Hello everyone,

I need some help getting my deskew batch script working.
I want to deskew about 100 JPG files located in my folder C:\gimp
I'm running Windows 7 64-bit
Here's what I have:

1. A batch-deskew.scm file in: C:\Program Files (x86)\GIMP-2.0\bin
The following is its code:

(define (batch-deskew pattern)
(let* ((filelist (cadr (file-glob pattern 1))))
(while (not (null? filelist))
(let*
(
(filename (car filelist))
filename filename)))
(drawable (car (gimp-image-get-active-layer image)))
)
(gimp-deskew-plugin 0 image drawable 0 0 0 0 0)
(gimp-image-resize-to-layers image)
(gimp-layer-flatten drawable)

(gimp-file-save RUN-NONINTERACTIVE
image drawable filename filename)
(gimp-image-delete image)

)
(set! filelist (cdr filelist))
)
)
)

2. The deskew plug-in in this folder: C:\Program Files (x86)\GIMP-2.0\lib\gimp\2.0\plug-ins

3. A batch file called gimpdeskew_jpg in the folder C:\gimp
The following is the batch code:
@echo off
cd C:\Program Files (x86)\GIMP-2.0\bin
gimp-2.6 -i -b "(batch-deskew \"C:\\gimp\\*.jpg\")" -b "(gimp-quit 0)"

4. About 100 JPG files in the folder C:\gimp

When I execute gimpdeskew_jpg I get an error message in the command prompt: "batch command experienced an execution error."

What am I doing wrong?

### I also get this error. I am

I also get this error. I am trying the simple bilateral blur filter. I believe it is not registered correctly in the gimp PDB. The question is, how can you add the plugin to PDB after you copy it to the plugin directory?

### that is done automatically by

that is done automatically by the script, if was not done correctly you would be not be able to call the script from the menu

### scheme gotcha

If you are calling a scheme file from another scheme file you need to call it by with scheme parameters, not the registered plugin parameters (specifically no interactive parameter!)

For example my chisel script:
http://registry.gimp.org/node/24217

If you want to call this from another scheme script you need to use:

(script-fu-chisel img Layer 20 0 1 135 20 20 0 0 0 FALSE)

NOT

(script-fu-chisel RUN-NONINTERACTIVE img Layer 20 0 1 135 20 20 0 0 0 FALSE)

-Rob A>

### 1. A batch-deskew.scm file

1. A batch-deskew.scm file in: C:\Program Files (x86)\GIMP-2.0\bin

In order for the defined procedure to be available in GIMP, you need to place the .scm file into one of the directories listed in "Edit->Preferences::Folders->Scripts". Is your "bin" directory included in that list?