Re: Perl function problem - hue_saturation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When developing a script, it is a very good idea to see if what you 
want done can be done by hand first.  This is an excellent demonstration
of that principle.  When you try it by hand, you'll see that when you 
open a gif, hue_saturation is not availble - it does not know how to 
operate on an indexed image.  Do a 'Gimp->convert_rgb $image' prior
to calling the hue_saturation and see if that fixes your problem.

Now, this does point out 2 problems in Gimp; I'd encourage you to submit
patches to either/or if you can find the time.  First, the PDB
documentation doesn't mention its indexed limitation.  Second, Gimp is 
not terribly friendly with regard to type definition in the PDB; it 
should have come back with an error saying "Cannot perform 
hue_saturation on an indexed image at line 3 in buttondemo.cgi" or 
something similarly helpful.  Until the latter is solved, its best to
assume that you have to handle types yourself.

Best of luck on your autogeneration program!

Seth Burgess
sjburges@xxxxxxxx

* Paul Grenier (paul@xxxxxxxxxxxxxxxxxx) [000612 18:50]:
>     I'm having a problem calling the gimp_hue_saturation function under
> a perl script (Gimp v.1.1.20).  It gives me the relatively worthless
> error of "buttondemo.cgi: gimp_hue_saturation: procedural database
> execution failed at ./buttondemo.cgi"
> 
> The code I'm using is below  (it's just a demo, but the finished site
> maker has got to be done in two months!  deadline! ack!  Help would be
> much appreciated!)
> 
> 
> $image = gimp_file_load("../htdocs/buttondemo/tux.gif", "tux.gif");
> $drawable=gimp_image_active_drawable($image);
> gimp_hue_saturation($drawable,1,50,10,10);
> $drawable->file_save ("../htdocs/buttondemo/tux.gif", "tux.gif");
> 
> 
> Thanks!
> 
>             - Paul


[Index of Archives]     [Video For Linux]     [Photo]     [Yosemite News]     [gtk]     [GIMP for Windows]     [KDE]     [GEGL]     [Gimp's Home]     [Gimp on GUI]     [Gimp on Windows]     [Steve's Art]

  Powered by Linux