(define (script-fu-copyright text placement) (let* ( (theImage (car (file-pnm-load 0 "/tmp/temp.ppm" "/tmp/temp.ppm"))) (theImageWidth (car (gimp-image-width theImage))) (theImageHeight (car (gimp-image-height theImage))) (points (if (< theImageWidth 300) 10 12)) (theTextExtents (gimp-text-get-extents text points PIXELS "adobe" "helvetica" "bold" "r" "normal" "*" "*" "*")) ; Used to need a fudge factor; fixed in 2.0 ; (theTextWidth (* (car theTextExtents) 1.0)) (theTextWidth (car theTextExtents)) (theTextHeight (cadr theTextExtents)) (placeX) (placeY) ) (gimp-palette-set-foreground '(255 255 255)) (if (= (strcmp placement "NW") 0) (begin (set! placeX 3) (set! placeY 3) )) (if (= (strcmp placement "NE") 0) (begin (set! placeX (- (- theImageWidth 3) theTextWidth)) (set! placeY 3) )) (if (= (strcmp placement "SW") 0) (begin (set! placeX 3) (set! placeY (- theImageHeight theTextHeight)) )) (if (= (strcmp placement "SE") 0) (begin (set! placeX (- (- theImageWidth 3) theTextWidth)) (set! placeY (- theImageHeight theTextHeight)) )) (gimp-text theImage -1 placeX placeY text 0 TRUE points PIXELS "adobe" "helvetica" "bold" "r" "normal" "*" "*" "*") (gimp-image-flatten theImage) (file-pnm-save 1 theImage (car (gimp-image-active-drawable theImage)) "/tmp/temp.ppm" "/tmp/temp.ppm" 1) ) ) (script-fu-register "script-fu-copyright" ; function name "/Xtns/Script-Fu/Copyright" ; menu position "Adds copyright notice to an image." ; short description "David Flater" ; author "Copyright 1999 David Flater" ; copyright notice "August 1, 1999" ; date created/modified "" ; image types it can work on SF-VALUE "Text String" "\"(C) 1999 David Flater. http://www.flaterco.com/\"" SF-VALUE "Placement" "\"SE\"" )