GNOME Bugzilla – Bug 171374
Gimp-2.0 Error in Help section 2.8. A Script-Fu Tutorial
Last modified: 2005-03-23 17:47:46 UTC
Distribution/Version: 2.0.4 Look at section 2.8 in the help. Excellent tutorial by the way! In section 8.5-Creating A New Image, code: (define (script-fu-text-box inTest inFont inFontSize inTextColor) should be: (define (script-fu-text-box inText inFont inFontSize inTextColor) In section 8.5-Adding A New Layer To The Image, code: ;create a new layer for the image: (theLayer (car (gimp-layer-new theImage theImageWidth theImageHeight RGB_IMAGE "layer 1" 100 NORMAL ) ) ) ) ;end of our local variables RGB_IMAGE doesn't work nor does GIMP_RGB_IMAGE as per docs. Had to use: 0 ;GIMP_RGB_IMAGE In section 8.5-Adding The Text, code: (gimp-selection-all theImage) (gimp-edit-clear theImage theLayer) (gimp-selection-none theImage) Changing: (gimp-edit-clear theImage theLayer) to: (gimp-edit-clear theLayer) works! In section 8.5-Adding The Text, code: (set! theText (car (gimp-text theImage theLayer 0 0 inText 0 TRUE inFontSize PIXELS "*" "*" "*" ) ) ) Updated to: (set! theText (car (gimp-text theImage theLayer 0 0 inText 0 TRUE inFontSize PIXELS "*" "*" "*" "*" "*" "*" "*" "*" ) ) ) In section 8.6-Modifying The Parameters And The Registration Function, code: (define (script-fu-text-box inTest inFont inFontSize inTextColor) should be: (define (script-fu-text-box inText inFont inFontSize inTextColor inBufferAmount) In section 8.6-Adding The New Code, code: (set! theBuffer (* theImageHeight (/ inBufferAmount 100) ) )
Eeek, that tutorial is so hopelessly outdated, it should either be removed or given a complete overhaul. I'll try to do the later.
In the meantime, I have fixed the errors you pointed out, in CVS. 2005-03-23 Bill Skaggs <weskaggs@primate.ucdavis.edu> * src/using/script-fu-tutorial.xml: fix several errors, as pointed out by Greg Reeve in bug #171374. Incidentally, when using a constant such as GIMP_FOO_BAR in script-fu, it should be rewritten in the form FOO-BAR, so using RGB-IMAGE should have worked for you. Thanks for the information.
That was a bit of a quick shot if you ask me. You didn't even fix the most obvious mistakes in the example code... 2005-03-23 Sven Neumann <sven@gimp.org> * src/using/script-fu-tutorial.xml: updated the example to not use deprecated procedures, to register the script properly and started to explain some of the new parameter types.