I had been using a script that worked fine in gimp 2.4, but when I tried to 
recently use this script in Windows 2.6.3 I got the following error:


The script that I was using is this:

; Script to create a gradient from an image of a gradient
; Rob Antonishen

(define (script-fu-gradient-from-image img inLayer inSegments inSmooth inName)
          (img (car (gimp-image-duplicate img)))  ;create a duplicate
          (width (car (gimp-image-width img)))
          (height (car (gimp-image-height img)))
          (segments (truncate inSegments))
          (colors (+ segments (if (= inSmooth TRUE) 1 0)))
          (theGradient "")
          (counter 0)
        ; it begins here
        (gimp-image-undo-group-start img)

        ;flatten inage and get drawable (layer)
        (set! inLayer (car (gimp-image-merge-visible-layers img 1)))
        ; blur then resize to number of colors  by 1
    (gimp-image-scale img colors 1)
    ;create new gradient
        (set! theGradient (car (gimp-gradient-new inName)))
        (gimp-context-set-gradient theGradient)
        (gimp-gradient-segment-range-split-uniform theGradient 0 0 segments)

        (while (< counter segments)     
            (gimp-gradient-segment-set-left-color theGradient counter (car 
(gimp-image-pick-color img inLayer counter 0 FALSE FALSE 0)) 100)
            (gimp-gradient-segment-set-right-color theGradient counter (car 
(gimp-image-pick-color img inLayer (+ counter (if (= inSmooth TRUE) 1 0)) 0 
FALSE FALSE 0)) 100)
                (set! counter (+ counter 1))
        (gimp-image-undo-group-end img)
        (gimp-image-delete img)

(script-fu-register "script-fu-gradient-from-image"
                            "<Image>/Colors/Gradient from Image..."
                    "Dreate a gradient from an image of a gradient."
                    "Rob Antonishen"
                    "Rob Antonishen"
                    SF-IMAGE      "image"      0
                    SF-DRAWABLE   "drawable"   0
                    SF-ADJUSTMENT "Segments in the gradient" (list 25 2 1024 1 
                                    SF-TOGGLE     "Smooth Gradient" TRUE
                    SF-STRING     "Gradient Name"  "Gradient From Image"        

what is the correct type for argument 3?

Gimp-user mailing list

Reply via email to