Hello,
i need this batch script to pass a jpeg to gimp console and run my script "CleanUpScan" on it.
The script also attempts to read the file and save it as .png.
The batch:
cd %~dp0
data\GIMPPortable\App\gimp\bin\gimp-2.8.exe -i -v -b '(CleanUpScan "C:\Users\C7X43T\Desktop\pngmin\CCI27042017.jpg")' -b '(gimp-quit 0)'
pause
CleanUpScan.scm as attachment.
Important snippets from the script:
Function header and variable declaration:
(define (CleanUpScan filename)
(let* (
(img (car (gimp-file-load RUN-NONINTERACTIVE filename filename)))
(nroflayers 0)
(layers '())
(height (car (gimp-image-height img)))
(width (car (gimp-image-width img)))
(index1 0)
(y 0)
(isCurrentLayerVisible #f)
)
Saving the image as png:
;save image -> export as png
;get layer names (in an array)
(set! layers (cadr (gimp-image-get-layers img)))
(file-png-save2 0 img (aref layers 0) filename filename 0 9 1 0 0 1 0 0 1)
Problem: I suppose there is an issue with reading the file since the gimp process starts up and immediately shuts down.
Output on console:
(gimp-2.8.exe:8372): LibGimpBase-WARNING **: gimp-2.8.exe: gimp_wire_read(): error
batch command executed successfully
Attachment:
CleanUpScan.scm [6.5 KiB]
Downloaded 151 times