Fri May 01, 2015 7:16 pm
>>> img
<gimp.Image 'bla.xcf'>
>>> img.ID
6
>>> pdb.file_pdf_save_multi([img.ID], 0, 0, 1, 1, "/tmp/test.pdf", "/tmp/test.pdf")
Traceback (most recent call last):
File "<input>", line 1, in <module>
RuntimeError: Procedure 'file-pdf-save-multi' returned no return values
Fri May 01, 2015 9:08 pm
pdb.file_pdf_save_multi([img.ID], 0, 0, 1, 1, "/tmp/test.pdf", "/tmp/test.pdf")
Sat May 02, 2015 7:01 am
Sat May 02, 2015 9:12 am
Sat May 02, 2015 10:58 am
ofnuts wrote:Might be a bug. If the array contains image ids (ints), the python support segfaults. But if you use image objects (as you would do in most PDB calls that are documented as taking image ids) you get a "TypeError: subscript of wrong type" from a routine that checks that the array indeed contains ints.
Sat May 02, 2015 11:14 am
jontait2 wrote:And that will very likely cause a segmentation fault. (I had exactly that problem when I was hacking the wavelet-denoise plugin for Dinasset.)
What is curious is that this plugin actually works at all - by all rights it should crap-out with a segmentation fault when invoked from Script-Fu as well!
Sat May 02, 2015 11:23 am
saulgoode wrote:The position of the array size argument in the list of parameters should not cause any difficulty from a PDB standpoint.
Sat May 02, 2015 12:14 pm
jontait2 wrote:Have you actually tried doing an ARRAY param without an INT32 preceding it?
Sat May 02, 2015 6:30 pm
img = pdb.gimp_file_load('/tmp/test.xcf', '/tmp/test.xcf')
ids = []
ids.append(img.ID)
pdb.file_pdf_save_multi(ids, 1, 0, 1, 1, "/tmp/test.pdf", "/tmp/test.pdf")
(file-pdf-save-multi 1 #(1) 1 0 1 1 "/tmp/test.pdf" "/tmp/test.pdf")
Sat May 02, 2015 7:14 pm
ragtag wrote:From what you say, it seems I may simply have stepped on a bug.
Sat May 02, 2015 10:31 pm
Sun May 03, 2015 2:13 pm
saulgoode wrote:The position of the array size argument in the list of parameters should not cause any difficulty from a PDB standpoint.
for (i = 0; i < n_params; i++)
{
:
:
switch (gimp_pdb_compat_arg_type_from_gtype (type))
{
:
:
case GIMP_PDB_INT32ARRAY:
count = g_value_get_int (&args->values[i - 1]); <------THIS IS ASSUMED TO BE THE LENGTH
if (full_copy)
gimp_value_set_int32array (&value,
params[i].data.d_int32array,
count);
else
gimp_value_set_static_int32array (&value,
params[i].data.d_int32array,
count);
break;
Sun May 03, 2015 4:14 pm
pdb.file_pdf_save_multi(0, [], 0, 1, 1, "", "",run_mode=0)
Mon May 04, 2015 3:30 pm