After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 171374 - Gimp-2.0 Error in Help section 2.8. A Script-Fu Tutorial
Gimp-2.0 Error in Help section 2.8. A Script-Fu Tutorial
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: Help
2.0.x
Other Linux
: Normal minor
: ---
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2005-03-23 16:42 UTC by Greg Reeve
Modified: 2005-03-23 17:47 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Greg Reeve 2005-03-23 16:42:34 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) ) )
Comment 1 Sven Neumann 2005-03-23 17:10:35 UTC
Eeek, that tutorial is so hopelessly outdated, it should either be removed or
given a complete overhaul. I'll try to do the later.
Comment 2 weskaggs 2005-03-23 17:26:05 UTC
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.
Comment 3 Sven Neumann 2005-03-23 17:47:46 UTC
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.