It is currently Thu Jul 04, 2024 5:05 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: [SOLVED]Error on run DESKEW plugin from Python-Fu console
PostPosted: Wed Aug 28, 2013 5:54 am  (#1) 
Offline
New Member

Joined: Aug 28, 2013
Posts: 3
I would like to run the (great!) Deskew plugin from the Python-Fu console.
I'm a very GIMP Python-Fu beginner, so i followed what user "asperge" did in the post shown above (tested-working Script-Fu batch version):
get the image (active image), get the drawable (active layer) and finally run plugin "deskew_plugin".
I put deskew.exe in the GIMP plugin folder, i opened GIMP, i loaded an image, then in the Python-Fu console i wrote:

image=gimp.image_list()[0]
drawable=image.active_layer
pdb.gimp_deskew_plugin(image, drawable, 0, 0, 0, 0, 0)

I get this error:

Traceback (most recent call last):
File "", line 1, in
RuntimeError: calling error


The working Script-Fu calling was:
(gimp-deskew-plugin 0 image drawable 0 0 0 0 0)
The only difference from the asperge's Script-Fu working version is that in my Phyton version there's no "0" before "image".
I guess it's the "run mode" parameter. If i try to insert it, i have an error for too much parameters:

Traceback (most recent call last):
File "", line 1, in
TypeError: wrong number of parameters


I would really appreciate any help.
Thankyou!
(Windows 8 64 bit, GIMP 2.8.6)


Last edited by ramonvaldezz on Wed Sep 04, 2013 5:33 am, edited 1 time in total.

Share on Facebook Share on Twitter Share on Orkut Share on Digg Share on MySpace Share on Delicious Share on Technorati
Top
 Post subject: Re: Error on run DESKEW plugin from Python-Fu console
PostPosted: Fri Aug 30, 2013 11:58 am  (#2) 
Offline
New Member

Joined: Aug 28, 2013
Posts: 3
SOLVED thanks to the help of paynekj:

pdb.gimp_deskew_plugin(image,drawable,0,0,0,0,0,run_mode=0)


Top
 Post subject: Re: Error on run DESKEW plugin from Python-Fu console
PostPosted: Fri Aug 30, 2013 7:40 pm  (#3) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14709
Location: USA
It's just so odd that the first variable from the procedural data base is run mode not image.
Odd that this works at all. Must be a python thing. :)

_________________
Image
Edmund Burke nailed it when he said, "The only thing necessary for the triumph of evil is for good men to do nothing."


Top
 Post subject: Re: [SOLVED]Error on run DESKEW plugin from Python-Fu console
PostPosted: Wed Sep 04, 2013 5:36 am  (#4) 
Offline
New Member

Joined: Aug 28, 2013
Posts: 3
Yes...quite strange.
The run mode is passed like an argument, but is not listed as argument in the plugin you call.
By the way, i will try the run mode argument with other plugins, just to check the behaviour.


Top
 Post subject: Re: [SOLVED]Error on run DESKEW plugin from Python-Fu console
PostPosted: Wed Sep 04, 2013 5:42 am  (#5) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14709
Location: USA
ramonvaldezz wrote:
Yes...quite strange.
The run mode is passed like an argument, but is not listed as argument in the plugin you call.
By the way, i will try the run mode argument with other plugins, just to check the behaviour.


In python i would follow that procedure always. :)

_________________
Image
Edmund Burke nailed it when he said, "The only thing necessary for the triumph of evil is for good men to do nothing."


Top
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Convert GIMP plugin from Python 2 to Python 3

4

No new posts Load As Layers Wire Initialization Error With Python

6

No new posts Curve Bend tool called from python giving error not very consistent.

0

No new posts Attachment(s) Macbook User and Python plugin

14

No new posts Unable to get simple python plugin to show up

8



* Login  



Powered by phpBB3 © phpBB Group