RSS/Atom feed Twitter
Site is read-only, email is disabled

script-fu problem in 2.6

This discussion is connected to the gimp-developer-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

10 of 12 messages available
Toggle history

Please log in to manage your subscriptions.

script-fu problem in 2.6 Luis A. Florit 16 Dec 19:21
  script-fu problem in 2.6 Sven Neumann 17 Dec 00:05
   script-fu problem in 2.6 saulgoode@flashingtwelve.brickfilms.com 17 Dec 01:34
    script-fu problem in 2.6 Sven Neumann 20 Dec 20:17
  script-fu problem in 2.6 Sven Neumann 17 Dec 00:08
   script-fu problem in 2.6 Luis A. Florit 17 Dec 01:04
  script-fu problem in 2.6 Kevin Cozens 24 Dec 06:39
mailman.235408.1229524283.1... 07 Oct 20:27
  script-fu problem in 2.6 Luis A. Florit 18 Dec 00:18
   script-fu problem in 2.6 saulgoode@flashingtwelve.brickfilms.com 18 Dec 09:21
mailman.235462.1229613643.1... 07 Oct 20:27
  script-fu problem in 2.6 Luis A. Florit 19 Dec 00:16
Luis A. Florit
2008-12-16 19:21:48 UTC (over 16 years ago)

script-fu problem in 2.6

Hi,

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)) )

Now it is broken.

How do I tell script-fu 2.6 to apply a layer mask (if it exists)? I was unable to find something like a boolean gimp-layear-has-mask, and gimp-layer-remove-mask returns an error if the mask does not exist.

Thanks!!

L.

Sven Neumann
2008-12-17 00:05:44 UTC (over 16 years ago)

script-fu problem in 2.6

Hi,

On Tue, 2008-12-16 at 16:21 -0200, Luis A. Florit wrote:

How do I tell script-fu 2.6 to apply a layer mask (if it exists)? I was unable to find something like a boolean gimp-layear-has-mask, and gimp-layer-remove-mask returns an error if the mask does not exist.

Perhaps we need to add gimp-layear-has-mask then. Until then you could use gimp-plugin-set-pdb-error-handler to take over the error handling in order to suppress the warning.

Sven

Sven Neumann
2008-12-17 00:08:01 UTC (over 16 years ago)

script-fu problem in 2.6

Hi,

On Tue, 2008-12-16 at 16:21 -0200, 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)) )

Now it is broken.

How exactly is it broken? It really doesn't help to say that something is broken if you don't explain in more detail what happens and what you expect to happen. This might be a bug that can be fixed easily, but we need a useful error description and perhaps a simple test script in order to find out.

Sven

Luis A. Florit
2008-12-17 01:04:00 UTC (over 16 years ago)

script-fu problem in 2.6

* El 17/12/08 a las 0:08, Sven Neumann chamullaba:

Hi,

On Tue, 2008-12-16 at 16:21 -0200, 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)) )

Now it is broken.

How exactly is it broken? It really doesn't help to say that something is broken if you don't explain in more detail what happens and what you expect to happen. This might be a bug that can be fixed easily, but we need a useful error description and perhaps a simple test script in order to find out.

Sorry, you're right (although I was as clear as script-fu itself...) GIMP just opens the typical pop-up window saying that there was an error in the procedure, without saying which kind error was it). I don't have 2.6 installed here, sorry for not being more precise. I expect no error, of course.

Perhaps we need to add gimp-layear-has-mask then.

Or at least gimp-layer-remove-mask to do nothing if no mask exists. Strange that the script-fu routine worked in 2.4: the routine gimp-layer-get-mask returns the mask, it is not boolean, so it shouldn't really work as a conditional...

Until then you could use gimp-plugin-set-pdb-error-handler to take over the error handling in order to suppress the warning.

But then the script will not work in 2.4 (could not find that procedure in 2.4).

Thanks,

L.

saulgoode@flashingtwelve.brickfilms.com
2008-12-17 01:34:34 UTC (over 16 years ago)

script-fu problem in 2.6

Quoting Sven Neumann :

Perhaps we need to add gimp-layear-has-mask then. Until then you could use gimp-plugin-set-pdb-error-handler to take over the error handling in order to suppress the warning.

I haven't been following this discussion that closely; however, I would point out that the PDB function 'gimp-layer-get-mask' will return "-1" if the layer does not have a mask.

Luis A. Florit
2008-12-18 00:18:00 UTC (over 16 years ago)

script-fu problem in 2.6

saulgoode@flashingtwelve.brickfilms.com wrote:

Perhaps we need to add gimp-layear-has-mask then. Until then you could use gimp-plugin-set-pdb-error-handler to take over the error handling in order to suppress the warning.

I haven't been following this discussion that closely; however, I would point out that the PDB function 'gimp-layer-get-mask' will return "-1" if the layer does not have a mask.

Yes. I manage to use that in 2.4 (because some strange reason), but the method does not work in 2.6. How would you make it work?

Thanks,

L.

saulgoode@flashingtwelve.brickfilms.com
2008-12-18 09:21:00 UTC (over 16 years ago)

script-fu problem in 2.6

Quoting "Luis A. Florit" :

I haven't been following this discussion that closely; however, I would point out that the PDB function 'gimp-layer-get-mask' will return "-1" if the layer does not have a mask.

Yes. I manage to use that in 2.4 (because some strange reason), but the method does not work in 2.6. How would you make it work?

(unless (= (car (gimp-layer-get-mask SharpenLayer)) -1) (gimp-layer-remove-mask SharpenLayer MASK-APPLY) )

Luis A. Florit
2008-12-19 00:16:02 UTC (over 16 years ago)

script-fu problem in 2.6

I haven't been following this discussion that closely; however, I would point out that the PDB function 'gimp-layer-get-mask' will return "-1" if the layer does not have a mask.

Yes. I manage to use that in 2.4 (because some strange reason), but the method does not work in 2.6. How would you make it work?

(unless (= (car (gimp-layer-get-mask SharpenLayer)) -1) (gimp-layer-remove-mask SharpenLayer MASK-APPLY) )

Thanks!!

L.

Sven Neumann
2008-12-20 20:17:05 UTC (over 16 years ago)

script-fu problem in 2.6

Hi,

On Tue, 2008-12-16 at 19:34 -0500, saulgoode@flashingtwelve.brickfilms.com wrote:

Quoting Sven Neumann :

Perhaps we need to add gimp-layear-has-mask then. Until then you could use gimp-plugin-set-pdb-error-handler to take over the error handling in order to suppress the warning.

I haven't been following this discussion that closely; however, I would point out that the PDB function 'gimp-layer-get-mask' will return "-1" if the layer does not have a mask.

Right, that should actually be sufficient. I don't think we need to add additional API then.

Sven

Kevin Cozens
2008-12-24 06:39:31 UTC (over 16 years ago)

script-fu problem in 2.6

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.