Folks, I am at my wit's end.

The included script worked just fine before upgrading from 2.2 to 2.6. I've
been all through the migration guide, etc. and can't figure out why this
script that has always worked fine, now suddenly returns "error: Procedure
execution of gimp-image-convert-indexed failed on invalid input arguments:
Image 'bulletin.gif' (13) is already of type 'indexed' "

The first thing I do after opening the image is to call
(gimp-img-convert-rgb img), which I know works, because the script then
proceeds to do all sorts of things that can't be done on an indexed image.
So clearly it isn't already of type 'indexed' and something is just plain
broken here.

Can anyone help please? Thanks! I know the list doesn't like attachments, so
I haven't attached the bulletin.gif, but I can if you need it.


(define (BulletinBoard_Blue_Header inText inFilename)
(let* (
    (drawable -1)
    (text inText)
    (filename inFilename)
    (gimp-context-set-foreground '(41 11 169))
    (img (car (gimp-file-load 1
"C:\\userfiles\\admin\\images\\GIMP\\bulletin.gif" "bulletin.gif")))
    (gimp-image-convert-rgb img)
    (background-layer (car (gimp-image-get-active-drawable img)))
    (gimp-hue-saturation background-layer 0 -108 0 0)
    (size 48)
    (font "Inkpen2 Script")
    (text-layer (car (gimp-text-fontname img -1 0 0 text 0 TRUE size PIXELS
    (height (car (gimp-drawable-height text-layer)))
    (width (car (gimp-drawable-width text-layer)))
    (scale (/ 600 width))
    (scale-width (trunc (* width scale)))
    (scale-height (trunc (* height scale)))
    (if (< scale 1)
        (gimp-layer-scale text-layer 600 scale-height 0 0)
    (height (car (gimp-drawable-height text-layer)))
    (width (car (gimp-drawable-width text-layer)))
    (theAngle 5)
    (radians (* theAngle (/ 3.14 -180)))
    (x-val (/ height 2))
    (y-val (/ height 2))
    (x-offset (/ (- 650 width) 2))
    (y-offset (/ (- 120 height) 2))
    (bg-color '(255 255 255))

    (gimp-selection-none img)
    (gimp-layer-resize text-layer (+ 10 width) height 10 0)
    (gimp-layer-set-preserve-trans text-layer TRUE)
    (gimp-layer-translate text-layer x-offset y-offset)
    (gimp-drawable-transform-rotate text-layer radians TRUE x-val y-val 0 2
    (gimp-selection-none img)
    (gimp-layer-set-preserve-trans text-layer FALSE)
    (plug-in-unsharp-mask 1 img text-layer 2 .5 8)
    (gimp-image-merge-down img text-layer 2)
    (gimp-image-convert-indexed img NO-DITHER MAKE-PALETTE 255 FALSE 1
    (set! drawable (car (gimp-image-get-active-layer img)))
    (gimp-file-save 1 img drawable filename filename)

(script-fu-register "BulletinBoard_Blue_Header"
            _"_BulletinBoard Blue Header"
            "Masthead treatment for COL Layout5a_BulletinBoard_Blue Designs"
            "Roger Penn"
            "Roger Penn"
            SF-STRING     _"Text"               "Community Church"
            SF-STRING      _"File Name"

(script-fu-menu-register "BulletinBoard_Blue_Header"
Gimp-developer mailing list

Reply via email to