Use of LayerFx Stroke - Printable Version +- Gimp-Forum.net (https://www.gimp-forum.net) +-- Forum: GIMP (https://www.gimp-forum.net/Forum-GIMP) +--- Forum: Extending the GIMP (https://www.gimp-forum.net/Forum-Extending-the-GIMP) +---- Forum: Scripting questions (https://www.gimp-forum.net/Forum-Scripting-questions) +---- Thread: Use of LayerFx Stroke (/Thread-Use-of-LayerFx-Stroke) |
Use of LayerFx Stroke - dinasset - 03-16-2018 I'm trying to use (from inside a .py filter) the effect "stroke" of the filter "layerfx.py". While interactively both options ("color" and "gradient", didn't test the pattern) work properly, when called the option "color" works, the option "gradient" gives an ununderstandable error message (something like: wrong number of parameters, expected maximum 4 received 8). Hence there should be something wrong in my call. I wrote a little filter for testing, some expert can simply read the source and find the error or run the minifilter and test the 2 options (default=color, gradient only if chosen). Thanks for any help. (I'm running Windows 10 64bits, but the problem has been confirmed also on a system running Windows 7 32bits) RE: Use of LayerFx Stroke - Ofnuts - 03-16-2018 (03-16-2018, 03:07 PM)dinasset Wrote: I'm trying to use (from inside a .py filter) the effect "stroke" of the filter "layerfx.py". Nothing to do with your code, alas(*). It seems that the message come from there: Code: case GIMP_PDB_COLOR: In other words, the plugin interface defines a parameter which is a PDB_COLOR. Since the call parameter is a tuple it is used to create a color, expecting 3 or 4 arguments but getting 8 from the gradient definition. In interactive mode, the code isn't called via the PDB, so there is no parameter conversion and the "fill" parameter type can be anything. So,layerfx.py needs to be fixed. Given its interface it seems rather ancient and several things could be improved, like the unnecessary duplication of functions. Btw, the bug is so bad that is makes Gimp crash on Linux (fortunately after the error messages have been issued). (*) but you can remove the double parentheses in ((160,160,160,255)) RE: Use of LayerFx Stroke - dinasset - 03-17-2018 Thanks Ofnuts. Hence that function is unusable. |