[Gimp-developer] script-fu problem in 2.6
Kevin Cozens
kevin at ve3syb.ca
Tue Dec 23 21:39:31 PST 2008
Luis A. Florit wrote:
> I have a script-fu that worked fine in 2.4 and it's broken in 2.6.
> It had a conditional to apply the layer's mask if it exists. This is
> what it read:
>
> (cond
> ((gimp-layer-get-mask SharpenLayer)(gimp-layer-remove-mask SharpenLayer 0))
> )
There are two things wrong with the above. First, it calls gimp-layer-get-mask
but is missing the car to extract the returned value. Second, "cond" requires
a boolean to be returned for the test for it to work properly.
> (unless (= (car (gimp-layer-get-mask SharpenLayer)) -1)
> (gimp-layer-remove-mask SharpenLayer MASK-APPLY)
> )
One issue with the above is the use of "unless". This is defined by TinyScheme
but it is not a function defined in the R5RS.
I'm also wondering why use cond or unless when a simple if statement would do.
--
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
More information about the Gimp-developer
mailing list