Batch script will not run - I'm out of ideas

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,
as totally new both on script-fu and in this group I'll try not to stress your 
patience.
I made a script to downscale all images in a directory:
(define (autoskaler pattern width height)
  (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))))
             (gimp-drawable-transform-scale-default 
                                   image drawable 0.0 0.0 width height 1 1 )
             (gimp-image-resize  image width height 0 0)
             (gimp-file-save RUN-NONINTERACTIVE
                             image drawable filename filename)
             (gimp-image-delete image))
           (set! filelist (cdr filelist)))))
Saved it as  autoskaler.scm in ~/.gimp-2.2/scripts and tries to run it batch 
with: gimp -i  -b '(autoskaler "*.JPG" 1600.0 1200.0 )' '(gimp-quit 0)'
Then it presents me with: batch command: experienced an execution error. Hmm, 
tries the interactive script-fu console using (autoskaler "*.JPG" 1600.0 
1200.0 ) and it then says: 
ERROR: Procedural database execution failed:
    (gimp_drawable_transform_scale_default 1 2 0 0 1600 1200 1)
And now I can't figure out whats wrong since I have a reference to both an 
image and a layer. Most of the code I just copied from the batch section of 
the docs on gimp.org.
I really like the way gimp scales images, so it would be great to have this 
script work.
Best regards
Knut



------------------------ Yahoo! Groups Sponsor --------------------~--> 
1.2 million kids a year are victims of human trafficking. Stop slavery.
http://us.click.yahoo.com/.QUssC/izNLAA/TtwFAA/e4wwlB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/script-fu/

<*> To unsubscribe from this group, send an email to:
    script-fu-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 




[Index of Archives]     [Gimp Developers]     [Gimp Users]     [Yosemite News]     [Epson Inkjet Printers]     [Scanners]     [Gimp's Home]     [Steve's Art]

&hbsp; Powered by Linux