(define (crop-size-sharp-curve pattern x-offset y-offset width height new-width new-height x-at-y0 x-at-y255) (let* ((filelist (cadr (file-glob pattern 1)))) (while filelist (let* ((filename (car filelist)) (image (car (gimp-file-load RUN-NONINTERACTIVE filename filename))) (drawable (car (gimp-image-get-active-layer image))) (newfile (string-append "ed." filename)) (curve (cons-array 8 'byte))) (gimp-image-crop image width height x-offset y-offset) (gimp-image-scale image new-width new-height) (plug-in-sharpen RUN-NONINTERACTIVE image drawable 36) (aset curve 0 0) (aset curve 1 0) (aset curve 2 x-at-y0) (aset curve 3 0) (aset curve 4 x-at-y255) (aset curve 5 255) (aset curve 6 255) (aset curve 7 255) (gimp-curves-spline drawable HISTOGRAM-VALUE 8 curve) (gimp-file-save RUN-NONINTERACTIVE image drawable newfile newfile) (gimp-image-delete image)) (set! filelist (cdr filelist)))))