GimpTalk Announcement :
Try your digital-art skills against your fellow gimpers in GIMPtalk's Biweekly Art competition !


Board index » GimpTalk » GIMP General Help Web Development Services . Convert FLV to Cell Phone Format
Featured Tutorial : Learn how to create characters by Griatch
Search for :  


Post new topic Reply to topic   [ 9 posts ]  


Author Message
Offline
 Post subject: problem with python-fu script
PostPosted: Mon Nov 16, 2009 4:54 am 
User avatar

Joined:
Mon Apr 23, 2007 10:57 pm

Topics:
Posts: 8

Find User's Topics

I am using Gimp 2.6.7. I have python installed and run other Python-*** scripts successfully, but am having trouble with this one:

py_make_gradient.py
http://registry.gimp.org/node/17282

Installed and comes up fine. I can specify a file path and add the width parameter, and once it gave it a file name( but then not again after that). When I try to run it, I either get an empty gradient, or I get this error message:

Quote:
Traceback (most recent call last):
File "C:\Program Files\GIMP-2.0\lib\gimp\2.0\python\gimpfu.py", line 692, in response
dialog.res = run_script(params)
File "C:\Program Files\GIMP-2.0\lib\gimp\2.0\python\gimpfu.py", line 353, in run_script
return apply(function, params)
File "C:\Documents and Settings\Helena\.gimp-2.6\plug-ins\py_make_gradient.py", line 98, in make_gradient
pixel = pdb.gimp_drawable_get_pixel(drawable, x+1, y)
RuntimeError: execution error


It says it is tested to work with 2.6.6 and Windows XP.

Is it not compatible with 2.6.7? If not, I will uninstall, as I am not knowledgeble enough to do any script editing.



Top
 Profile  
 
Online
 Post subject: Re: problem with python-fu script
PostPosted: Mon Nov 16, 2009 8:42 am 
GT Manager

User avatar

Joined:
Mon Jun 13, 2005 11:15 am

Topics:
Posts: 10074

Find User's Topics
There are no changes in 2.6.7 that may broken a script, but you are right that script doesn't work

PS.
Quote:
I can specify a file path and add the width parameter, and once it gave it a file name(


Apparently the script pretend a path to be not for a folder but for a file , then the gradient overwrite the file ...that is very wrong :!:

But seems able to do that only once for Gimp session then only give errors



PS
i found a much better gradient script here

http://registry.gimp.org/node/15847

_________________
Image

http://www.flickr.com/photos/97844002@N00/


Top
 Profile  
 
Online
 Post subject: Re: problem with python-fu script
PostPosted: Mon Nov 16, 2009 10:05 am 
GT Manager

User avatar

Joined:
Mon Jun 13, 2005 11:15 am

Topics:
Posts: 10074

Find User's Topics
hum i try again 3 times

On third try almost worked once ...but i am not happy at all of result

A problem seems to be the path ,it does not accept a folder as path but path should be for a file( :?: ), then apparently overwrite the file at least it did once, then refused to work again giving only same errors you reported

But i am really perplex about this script, a script to create a gradient that does not allow to give a name to the new gradient and chose a folder to save, or at least to use it on the fly seems to me meaningless

As i said the RobA scripts to sample a gradient from a image, or even that to sample along a path seem very good alternatives

_________________
Image

http://www.flickr.com/photos/97844002@N00/


Top
 Profile  
 
Offline
 Post subject: Re: problem with python-fu script
PostPosted: Mon Nov 16, 2009 2:11 pm 
User avatar

Joined:
Wed Jun 01, 2005 3:30 pm

Topics:
Posts: 115

Find User's Topics
To me it looks unfinished. It's not using the "Gradient Type" input at all. It would allow you to enter a 0 for the Number of segments, causing a divide by zero error, and it's possible it might be trying to read values for pixels that don't exist, which is where it might be going wrong at the call to pdb.gimp_drawable_get_pixel

..update: It certainly appears that if you have an image which is an odd number of pixels wide (1, 3, 5, 7, 9....) then it will try to read the value of pixels that are one pixel off the right hand side.

_________________
Kevin
Image


Top
 Profile  
 
Online
 Post subject: Re: problem with python-fu script
PostPosted: Mon Nov 16, 2009 3:13 pm 
GT Manager

User avatar

Joined:
Mon Jun 13, 2005 11:15 am

Topics:
Posts: 10074

Find User's Topics
but why the script even refuse to accept folder to save the gradient? Save by forcefully replacing another file is a new concept for me

And even if, (for absurd )the script will successfully save the gradient how to guess how it would be called ?

I may be wrong but maybe the author by mistake upload a first draft of the script instead then the finished and working version

_________________
Image

http://www.flickr.com/photos/97844002@N00/


Top
 Profile  
 
Offline
 Post subject: Re: problem with python-fu script
PostPosted: Mon Nov 16, 2009 3:27 pm 
User avatar

Joined:
Wed Jun 01, 2005 3:30 pm

Topics:
Posts: 115

Find User's Topics
PhotoComix wrote:
but why the script even refuse to accept folder to save the gradient? Save by forcefully replacing another file is a new concept for me

And even if, (for absurd )the script will successfully save the gradient how to guess how it would be called ?

I may be wrong but maybe the author by mistake upload a first draft of the script instead then the finished and working version


I think you are right!

The name of the gradient is the name of the image that is used to create it (it removes the .jpg/.gif etc)

_________________
Kevin
Image


Top
 Profile  
 
Offline
 Post subject: Re: problem with python-fu script
PostPosted: Mon Nov 16, 2009 9:31 pm 
User avatar

Joined:
Mon Apr 23, 2007 10:57 pm

Topics:
Posts: 8

Find User's Topics
wow, what interesting responses. It's nice to know I am not just doing something wrong.

The naming thing puzzled me too. It did, on one occassion, give a numerical name to the new gradient file, but only once, and then it seemed to require you to overwrite and existing gradient file as you mention.

And thank you for that suggestion for a better gradient making script. I'll give that a try.

Edit: this gradient from image script works great...thanks! [once I finally found the Gradients menu...there are so many places to look for things..I need GPS map for Gimp, I think]

Quote:
http://registry.gimp.org/node/15847



Last edited by etherea on Tue Nov 17, 2009 6:22 am, edited 1 time in total.

Top
 Profile  
 
Online
 Post subject: Re: problem with python-fu script
PostPosted: Mon Nov 16, 2009 11:47 pm 
User avatar

Joined:
Mon Nov 05, 2007 3:16 pm

Topics:
Posts: 416

Find User's Topics
etherea wrote:
Edit: this gradient from image script works great...thanks! [once I finally found the Gradients menu...there are so many places to look for things..I need GPS map for Gimp, I think]

Quote:
http://registry.gimp.org/node/15847


You're welcome! Sorry for the hidden location, but the "new" idea is that scripts should show up in their correct context menu, so a script that creates a gradient should be in the gradient menu (not that people seem to realize the little triangle or right clicking even opens up a menu!)

-Rob A>


Top
 Profile  
 
Online
 Post subject: Re: problem with python-fu script
PostPosted: Tue Nov 17, 2009 12:12 am 
GT Manager

User avatar

Joined:
Mon Jun 13, 2005 11:15 am

Topics:
Posts: 10074

Find User's Topics
For the record: seems that Mahvin found a workaround to use the python script

Quote:
It works, just not explained well
What you have to do:
1 Open the gradient dialog and create a new gradient, name it whatever you want and save.

2 Then when opening the Py gradient plug-in, browse to that gradient file and select it, then set your color parameters and activate the plug-in.

3 Refresh your gradients dialog and presto, there will be the new gradient file.


" not explained well" is really a very kind euphemism i would like be able to be so polite

#######################################################################

RobA
as location is handy,... once discovered :D

_________________
Image

http://www.flickr.com/photos/97844002@N00/


Top
 Profile  
 
Display posts from previous:  Sort by  

Post new topic Reply to topic
 [ 9 posts ] 



Who is online

Users browsing this forum: Lisafer11, Pocky, RobA and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Related Website
Gimp tutorials database
All rights reserved © GimpTalk 2008
forum software by
phpBB