;;; add-comment.scm -*-scheme-*-
;;; Time-stamp: <1999/05/30 06:09:43 narazaki@gimp.org>
;;; Version 0.2
;;; Code:

(define (script-fu-add-comment img drw string)
  (if (< 213 (length string))
      (set! string (substring string 0 213)))
  (let* ((name "gimp-comment")
	 (para ;(car (gimp-image-find-parasite name))
	       (car (gimp-parasite-new name 1 (+ (length string) 1) string))))
    ;; (if para (gimp-image-detach-parasite img name))
    (gimp-image-attach-parasite img para)))

(script-fu-register 
 "script-fu-add-comment"
 "<Image>/Script-Fu/Utils/Add comment parasite"
 "Add(overwrite) a (permanent) gimp-comment parasite to the image."
 "Shuji Narazaki <narazaki@gimp.org>"
 "Shuji Narazaki"
 "1998"
 ""
 SF-IMAGE "image" 0
 SF-DRAWABLE "drawable" 0
 SF-STRING "Comment:" ""
)

;;; text-injection.scm ends here
