Hi Folks,
I'm trying to use this script to create a thumbnail of a jpg or gif
image. However I am not getting any results, no new image stored.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
;;;; Image Process Gimp script
;;;;
;;;; To run this from the command prompt:
;;;; gimp -c -d -i -b '(script-fu-create-thumb "file.jpg")' \
;;;; '(gimp-quit 0)'
;;
(define (script-fu-create-thumb filename)
(let* ((img 0))
;; car needed here because gimp functions return values as lists
(set! img (car (gimp-file-load 1 filename filename))
(gimp-file-save img filename)
(print (gimp-file-save-thumbnail img filename))))
)
(script-fu-register "script-fu-create-thumb"
"<Toolbox>/Xtns/Script-Fu/Utils/Thumbnail..."
"Thumbnail Image"
"Marty Bradley"
"Marty Bradley"
"Dec 2007"
""
SF-VALUE "Image Name" " ")
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Later on I edited the function to be as shown below.
Only the first gimp-message was output so maybe the
gimp-file-load is not sucessful.
(define (script-fu-create-thumb filename)
(let* ((img 0))
;; car needed here because gimp functions return values as lists
(gimp-message "About to start the thumbnail save")
(set! img (car (gimp-file-load 1 filename filename))
(if img
(gimp-message "Image not nil")
(gimp-message "Image is NIL!!!!!"))
(gimp-file-save img filename)
(when (gimp-file-save-thumbnail img)
(gimp-message "thumbnail saved?")))))
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
My System Details
Debian etch 4.0.
Linux debian 2.6.18-5-486
GIMP version 2.2.13
This is my first work with script-fu and to my shame I don't know much
about Gimp. Any help is appreciated.
thanks,
Martin
_______________________________________________
Gimp-user mailing list
[email protected]
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user