Re: [Gimp-user] Error while executing script (Script Stop Working in Windows 2.6.3)
Quoting Kevin Cozens ke...@ve3syb.ca: Your code has (if (= inSmooth TRUE) 1 0) where in Smooth is a boolean value provided by the SF-TOGGLE. The = operator is for use when comparing numbers, not booleans. Since inSmooth is a boolean, change your if statement to read (if inSmooth 1 0) saulgoode wrote: I am using version 2.6.4 on Linux and my experience is that the original script functions just fine for both TRUE and FALSE values of 'inSmooth'; however, if I modify the script per your instructions then the smoothing occurs even for FALSE values of inSmooth. This is as I would expect because SF-TOGGLEs are marshalled as integer constants in the PDB interface, not booleans (correct me if I am mistaken). I would ask Capnhud to verify whether the modified script produces the correct result after removing the '=' comparison (not just that no errors are generated). This can be done by running the script on an image consisting of only two colors, setting the number of segments to 2, and disabling smoothing. The resulting gradient should be a hard-edged transition between the two colors (as shown in this image: http://www.flashingtwelve.brickfilms.com/Temp/anomaly.png ). When used, SF-TOGGLEs are invariably initialized to the integer constants TRUE and FALSE in existing scripts. If there has been a change whereby SF-TOGGLE are now booleans then this would seem very problematic. If I leave the script it original form I get the error that has been mentioned. However as saulgoode has pointed out the script may not return an error per se, but no matter what it does not produce the intended result if smoothing is disabled. The resulting gradient will be smooth if only 2 segments are chosen and smoothing is disabled. So the question becomes what is making the script not produce the correct result? ___ Gimp-user mailing list Gimp-user@lists.XCF.Berkeley.EDU https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user
Re: [Gimp-user] Error while executing script (Script Stop Working in Windows 2.6.3)
Message: 6 Date: Sat, 13 Dec 2008 13:58:16 -0500 From: Kevin Cozens ke...@ve3syb.ca Subject: Re: [Gimp-user] Error while executing script (Script Stop Working in Windows 2.6.3) To: gimp-user gimp-user@lists.xcf.berkeley.edu Message-ID: 494405c8.9040...@ve3syb.ca Content-Type: text/plain; charset=us-ascii; format=flowed D.Jones (aka) Capnhud wrote: (colors (+ segments (if (= inSmooth TRUE) 1 0))) [snip] (while ( counter segments) (gimp-gradient-segment-set-left-color theGradient counter (car (gimp-image-pick-color img inLayer counter 0 FALSE FALSE 0)) 100) (gimp-gradient-segment-set-right-color theGradient counter (car (gimp-image-pick-color img inLayer (+ counter (if (= inSmooth TRUE) 1 0)) 0 FALSE FALSE 0)) 100) (set! counter (+ counter 1)) ) [snip] what is the correct type for argument 3? The procedure database indicates that a FLOAT (ie. a numerical value) is expected for argument 3 of gimp-image-pick-color. Your problem is due to invalid use of the = operator in the two if statements shown above. Your code has (if (= inSmooth TRUE) 1 0) where in Smooth is a boolean value provided by the SF-TOGGLE. The = operator is for use when comparing numbers, not booleans. Since inSmooth is a boolean, change your if statement to read (if inSmooth 1 0) -- Cheers! Kevin. Thanks for clarifying what the problem was. Those changes caused the script to function properly again. What I do not understand is why I was the only one that seem to have this problems while others indicated that the script without the changes worked just fine. Go figure:) ___ Gimp-user mailing list Gimp-user@lists.XCF.Berkeley.EDU https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user
Re: [Gimp-user] Error while executing script (Script Stop Working in Windows 2.6.3)
Quoting Kevin Cozens ke...@ve3syb.ca: Your code has (if (= inSmooth TRUE) 1 0) where in Smooth is a boolean value provided by the SF-TOGGLE. The = operator is for use when comparing numbers, not booleans. Since inSmooth is a boolean, change your if statement to read (if inSmooth 1 0) I am using version 2.6.4 on Linux and my experience is that the original script functions just fine for both TRUE and FALSE values of 'inSmooth'; however, if I modify the script per your instructions then the smoothing occurs even for FALSE values of inSmooth. This is as I would expect because SF-TOGGLEs are marshalled as integer constants in the PDB interface, not booleans (correct me if I am mistaken). I would ask Capnhud to verify whether the modified script produces the correct result after removing the '=' comparison (not just that no errors are generated). This can be done by running the script on an image consisting of only two colors, setting the number of segments to 2, and disabling smoothing. The resulting gradient should be a hard-edged transition between the two colors (as shown in this image: http://www.flashingtwelve.brickfilms.com/Temp/anomaly.png ). When used, SF-TOGGLEs are invariably initialized to the integer constants TRUE and FALSE in existing scripts. If there has been a change whereby SF-TOGGLE are now booleans then this would seem very problematic. ___ Gimp-user mailing list Gimp-user@lists.XCF.Berkeley.EDU https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user
Re: [Gimp-user] Error while executing script (Script Stop Working in Windows 2.6.3)
Quoting saulgo...@flashingtwelve.brickfilms.com: This is as I would expect because SF-TOGGLEs are marshalled as integer constants in the PDB interface, not booleans (correct me if I am mistaken). In the above, constants should be corrected to variables. ___ Gimp-user mailing list Gimp-user@lists.XCF.Berkeley.EDU https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user
Re: [Gimp-user] Error while executing script (Script Stop Working in Windows 2.6.3)
D.Jones (aka) Capnhud wrote: (colors (+ segments (if (= inSmooth TRUE) 1 0))) [snip] (while ( counter segments) (gimp-gradient-segment-set-left-color theGradient counter (car (gimp-image-pick-color img inLayer counter 0 FALSE FALSE 0)) 100) (gimp-gradient-segment-set-right-color theGradient counter (car (gimp-image-pick-color img inLayer (+ counter (if (= inSmooth TRUE) 1 0)) 0 FALSE FALSE 0)) 100) (set! counter (+ counter 1)) ) [snip] what is the correct type for argument 3? The procedure database indicates that a FLOAT (ie. a numerical value) is expected for argument 3 of gimp-image-pick-color. Your problem is due to invalid use of the = operator in the two if statements shown above. Your code has (if (= inSmooth TRUE) 1 0) where in Smooth is a boolean value provided by the SF-TOGGLE. The = operator is for use when comparing numbers, not booleans. Since inSmooth is a boolean, change your if statement to read (if inSmooth 1 0) -- Cheers! Kevin. http://www.ve3syb.ca/ |What are we going to do today, Borg? Owner of Elecraft K2 #2172 |Same thing we always do, Pinkutus: | Try to assimilate the world! #include disclaimer/favourite | -Pinkutus the Borg ___ Gimp-user mailing list Gimp-user@lists.XCF.Berkeley.EDU https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user