Post Reply 

Script-fu problems

Jun 9, 2014, 03:19 (This post was last modified: Jun 10, 2014 08:24 by Pokedan.)
Post: #1
Script-fu problems
This is my first script-fu, meant to go through a folder and run an unsharpen filter on all PNG files in that folder, there's still a lot to do but it's bugging up with the error "Error: ( : 1) illegal function". So if you would kindly point out my huge mistakes, I would be very thankful.

Oh yes, also, "SF-SLIDER" doesn't seem to be working.

Code:
(define (script-fu-unsharpen-mass image layer radius)
    (let* ((filelist (cadr (file-glob "/Users/grunow/Desktop/test/*.png" 0))))
        (while (not (null? filelist))
           (let* ((filename (car filelist)))
                 (image (car (file-png-load 0 filename filename)))
                 (layer (car (gimp-image-get-active-layer image)))
             (plug-in-unsharp-mask 0 image layer radius amount threshold)
             (gimp-file-save 0 image layer filename filename)
            )
        )
    )
    (set! filelist (cdr filelist))
)
(script-fu-register "script-fu-unsharpen-mass"
    "<Image>/Filters/Enhance/Unsharpen Mass..."
    "Unsharpen every PNG in a directory."
    "Pokedan"
    "Pokedan"
    "08/06/14"
    "RGB*, GRAY*"
    SF-IMAGE "Image" 0
    SF-DRAWABLE "Layer" 0
    SF-ADJUSTMENT "Radius"    '(5 0.1 500 4.5 1 1 SF-SLIDER)
    SF-ADJUSTMENT "Amount"    '(0.5 0 10 0.09 0.1 2 SF-SLIDER)
    SF-ADJUSTMENT "Threshold" '(0 0 255 2 10 0 SF-SLIDER)
)


Attached File(s)
.scm  script-fu-unsharpen-mass.scm (Size: 941 bytes / Downloads: 36)
Find all posts by this user
Quote this message in a reply
Jun 9, 2014, 06:46
Post: #2
RE: Script-fu problems
I updated it, but it's still giving me the same error.
Find all posts by this user
Quote this message in a reply
Jun 13, 2014, 09:26
Post: #3
RE: Script-fu problems
(Jun 9, 2014 15:54)paynekj Wrote:  
(Jun 9, 2014 06:46)Pokedan Wrote:  I updated it, but it's still giving me the same error.

I've sometimes seen the Illegal function error when the script file has non-ASCII characters in it. Could you try attaching it to a post so we can have a look at it.

Kevin

Done.
Find all posts by this user
Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Run script on action rchav 2 864 Aug 13, 2018 14:57
Last Post: rchav
  Script Fu Errors Gimp 2.10.4 lightsaber jd3481 1 551 Aug 2, 2018 05:13
Last Post: paynekj
  Script-fu script to conversion pdf to image 4ever 12 11,374 Jul 17, 2018 16:01
Last Post: paynekj
  Problems with a bat script :( ThaUnknown_ 1 525 Mar 26, 2018 21:14
Last Post: paynekj
  Script-fu ordered file list vnicent 1 337 Mar 19, 2018 17:33
Last Post: paynekj

Forum Jump:


GIMP ForumPortalArchiveContactTermsRSS