Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Stumped again - help, please?
#1
In the attachment, 2 Gimp plugins to do similar things: 
beginning from a multi-layered xcf file, with o without an active selection, copy visible and export the result as:
1. webp -- workaround for a (reported) bug in GIMP 10
2. indexed png
Plugin 1 works without trouble, and so 2 for 8 bit perceptual.
Now, other precisions cannot be converted to indexed directly, so I am trying workarounds--and always find myself against
Code:
TypeError: wrong parameter type

marked #### in the plugin.
Worse, after reading the PDB documentation, I fail to understand the whys and wherefores...
Thanks for any explanation/help!


Attached Files
.zip   Lazy-Body_toolbox1.zip (Size: 2.79 KB / Downloads: 249)
Reply
#2
Known bug... See the two possible work-arounds in the bug report comments. You can also use add_layer() which is deprecated but still works.

PS: have a look at os.path.splitext()
Reply
#3
(10-24-2019, 12:20 AM)Ofnuts Wrote: Known bug... See the two possible work-arounds in the bug report comments. You can also use add_layer() which is deprecated but still works.

PS: have a look at os.path.splitext()
Thanks again! 
When attempting my second plugin (and learning in the process) I would rather suspect myself--not a bug in the code...
And I just split the path much like I used to do in javascript some 20 years ago--beginning before there was a reliable W3 DOM.
Query: should one always try to import a dedicated module (when available) instead of using more basic methods?
I understand that to be the C approach, but--is it really more efficient for a such simple task as in my example?

Many thanks--hope not to become too great a bore!
Reply
#4
(10-24-2019, 07:58 AM)carmen Wrote: When attempting my second plugin (and learning in the process) I would rather suspect myself--not a bug in the code...

This is the right attitude... to a point(*). After that, nobody is going to disrespect you if you do a well documented bug report, even if it's not a bug after all. But in all likelihood, while writing a "watertight" bug report, either you figure out the problem yourself or there is really  a bug.  

(10-24-2019, 07:58 AM)carmen Wrote: And I just split the path much like I used to do in javascript some 20 years ago--beginning before there was a reliable W3 DOM.
Query: should one always try to import a dedicated module (when available) instead of using more basic methods?
I understand that to be the C approach, but--is it really more efficient for a such simple task as in my example?

1) using the module is more readable, and less likely to break on alien systems (for instance it will handle slashes and backslahes transparently between, Windows, Linux and OSX)
2) these are really built-in modules,  there is no performance penalty in using them.


(10-24-2019, 07:58 AM)carmen Wrote: Many thanks--hope not to become too great a bore!

If I didn't like to play Mr Know-it-all I would not have started this forum.

(*) I remember seeing a person rank C beginner complaining about bugs in GCC on StackOverflow
Reply
#5
How thankful I feel that you like to play Mr Know-it-all!

Now that my wrappers for saving as webp and png seem to work, I will attempt one for the exceedingly user-unfriendly 'Export path...'--and acquaint myself in the process with 'os.path.splitext'.
Reply


Forum Jump: