Gimptalk - Premier Gimp Community: problem with python-fu script - Gimptalk - Premier Gimp Community

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

problem with python-fu script

#1 User is offline   etherea 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 8
  • Joined: 23-April 07

Posted 16 November 2009 - 04:54 AM

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.
0

#2 User is offline   PhotoComix 

  • GT Senior Moderator
  • Group: Senior Moderators
  • Posts: 11,288
  • Joined: 13-June 05

Posted 16 November 2009 - 08:42 AM

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
0

#3 User is offline   PhotoComix 

  • GT Senior Moderator
  • Group: Senior Moderators
  • Posts: 11,288
  • Joined: 13-June 05

Posted 16 November 2009 - 10:05 AM

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
0

#4 User is offline   paynekj 

  • Member
  • PipPip
  • Group: Members
  • Posts: 360
  • Joined: 01-June 05
  • LocationUK

Posted 16 November 2009 - 02:11 PM

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
0

#5 User is offline   PhotoComix 

  • GT Senior Moderator
  • Group: Senior Moderators
  • Posts: 11,288
  • Joined: 13-June 05

Posted 16 November 2009 - 03:13 PM

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
0

#6 User is offline   paynekj 

  • Member
  • PipPip
  • Group: Members
  • Posts: 360
  • Joined: 01-June 05
  • LocationUK

Posted 16 November 2009 - 03:27 PM

PhotoComix said:

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
0

#7 User is offline   etherea 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 8
  • Joined: 23-April 07

Posted 16 November 2009 - 09:31 PM

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


0

#8 User is offline   RobA 

  • Member
  • PipPip
  • Group: Members
  • Posts: 714
  • Joined: 05-November 07

Posted 16 November 2009 - 11:47 PM

etherea said:

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



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>
Posted Image
Fantasy Cartography and Mapping by RobA
0

#9 User is offline   PhotoComix 

  • GT Senior Moderator
  • Group: Senior Moderators
  • Posts: 11,288
  • Joined: 13-June 05

Posted 17 November 2009 - 12:12 AM

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
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic