2

Error message from gimp - pdb.file_png_save2(...) (wrong parameter type) - parameters seem to follow doc but still gives error...

In a plug-in/script module I am trying to save a .png file. I am using pdb.file_png_save2() because I need to preserve transparency. I am getting nowhere. The following is from the python-fu console.

>>> img=gimp.image_list()[0]
>>> lyr=img.layers[0]
>>> pdb.file_png_save2(img, lyr, "/tmp/untitled14.png", "untitled14.png", False, 9, False, False, False, False, False, "", True)
Traceback (most recent call last):
   File "<input>", line 1, in <module>
TypeError: wrong parameter type

And just to verify that the objects are valid --->

>>> img
<gimp.Image 'I230112341bgsl.jpg'>
>>> lyr
<gimp.Layer 'Background'>
>>> 

So, which parameter is wrong type. And if so where is there any real documentation (ie not from the pdb browser 'explanation' - because that is obviously insufficient)

Chrys G
  • 99
  • 10

1 Answers1

4

The comment (next to last) should be a Boolean (type INT32 in the documentation...). It is not the comment itself, but tells if the image comment (from Image>Properties) is written.

The PDB is usually sufficient. Of course it is generated from the docs more meant for script-fu but the mappings are reasonably consistent.

xenoid
  • 8,396
  • 3
  • 23
  • 49
  • Of course! I have no idea why after staring at the pdb database for ages, my eyes missed that. Danke! – Chrys G Nov 04 '19 at 14:39
  • 1
    I ended up using trying the alternative of doing the save in two steps. 1) pdb.file_png_set_defaults() and then 2) pdb.file_png_save_defaults() – Chrys G Nov 04 '19 at 14:42