Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Use of LayerFx Stroke
#1
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)


Attached Files
.7z   DIEGO_TEST_TestLayerFx.7z (Size: 988 bytes / Downloads: 40)
Reply
#2
(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".
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)

Nothing to do with your code, alas(*). It seems that the message come from there:

Code:
    case GIMP_PDB_COLOR:
        value = pygimp_rgb_new(&params[i].data.d_color);
        break;

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))
Reply
#3
Thanks Ofnuts.
Hence that function is unusable.
Reply


Forum Jump: