Hello, I'm developing a plugin for GIMP and I ended using "GIMP_PDB_INT8ARRAY"
as a return value. My problem is that when you use an *ARRAY as return value the
previous return value has to be the number of elements of the array. As you can
see in the source code of gimp:

/* extracted form libgimpbase/gimpprotocol.c */

case GIMP_PDB_INT8ARRAY:
          (*params)[i-1].data.d_int32 = MAX (0, (*params)[i-1].data.d_int32);
          (*params)[i].data.d_int8array = g_new (guint8,
                                                 (*params)[i-1].data.d_int32);
          if (! _gimp_wire_read_int8 (channel,
                                      (*params)[i].data.d_int8array,
                                      (*params)[i-1].data.d_int32,
                                      user_data))
            {
              g_free ((*params)[i].data.d_int8array);
              goto cleanup;
            }
          break;

I think that if a newbie developing plugins uses this value(an array type) he
will miss that he has to add the size before of it. I have miss a few a days of
development due to this problem. I would like that you add this information to
the API or the tutorial of "Kevin Corner" so others developers don't go thought
this problem.

Sorry if it's explained in some other place and i have just missed it. Sorry for
my English too...

Nico

-------------------------------------------------
This mail sent through IMP: http://horde.org/imp/
_______________________________________________
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer

Reply via email to