Sign up now! · Forgot password?
RSS/Atom feed Twitter

Scripted Gimp Protocol 1 error

This discussion is connected to the gimp-user-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

5 of 6 messages available
Toggle history

Please log in to manage your subscriptions.

Scripted Gimp Protocol 1 error As Signed 17 Apr 02:03
  Scripted Gimp Protocol 1 error Marc) (A.) (Lehmann 19 Apr 19:06
   Scripted Gimp Protocol 1 error Guillermo S. Romero / Familia Romero 19 Apr 20:44
   Scripted Gimp Protocol 1 error As Signed 22 Apr 09:15
k02f@videotron.ca 07 Oct 20:15
  Scripted Gimp Protocol 1 error Jeff Trefftzs 22 Apr 06:04
As Signed
2002-04-17 02:03:14 UTC (over 19 years ago)

Scripted Gimp Protocol 1 error

gimp-user@lists.xcf.berkeley.edu

My ISP doesn't carry the gimp group and I tried posting via mixmaster but nothing gets on. Is the ng moderated and dumping anon posts?

Could anyone please help me get a perl script invoked from HTML via the local server run Gimp?

I have one conventional perl script that invokes other progs. I was hoping to also launch The Gimp from within this script and then have it return control to the calling script to continue with getting the images into an html page.

The only thing I've been able to do is a separate standalone script launch The Gimp, do some graphics and save them to disk before quitting. Then I have to restart the original script to carry on with loading the saved images.

Also, this standalone script must run from a bash shell or from a directly commanded bash script. It refuses to run either from any script via local served html.

Is there something Gimp-specific that Apache (1.3.2) must have installed? I get server errors but not much in the logs which might suggest scripting syntax but Gimp has proven finicky enough to undermine this hunch.

I've tried commands & syntax like...

system('/usr/..path/gimpit.pl'); protocol error (1) at
/usr/lib/perl5/site_perl/5.6.1/i586-linux/Gimp/Net.pm line 66.

system('/usr/bin/gimp'); Gtk-WARNING **: cannot open display:

system('/usr/bin/gimp-remote -n /usr/...path/test.png'); Gtk-WARNING **: cannot open display:

... the above 2 are less valuable as I DON'T want display.

eval { require("/usr/..path/gimpit.pl"); };
...nothing.

print"gimpit.pl"; protocol error (1) at
/usr/lib/perl5/site_perl/5.6.1/i586-linux/Gimp/Net.pm line 66.

A bash script, otherwise able to launch gimpit.pl, invoked from perl/html also results in
protocol error (1) at
/usr/lib/perl5/site_perl/5.6.1/i586-linux/Gimp/Net.pm line 66.

which is here... (line #'s added for clarity) 63 # this is hardcoded into gimp_call_procedure! 64 sub response {
65 my($len,$req);
66 read($server_fh,$len,4) == 4 or die "protocol error (1)"; 67 $len=unpack("N",$len);
68 read($server_fh,$req,$len) == $len or die "protocol error (2)"; 69 net2args(0,$req);
70 }
... & a long long way over my head!

Would appreciate any pointers. Sorry if this is not exactly GIMP stuff, but the perl groups will say it's not perl, and www will say it's apache... etc ;-) and who would know better than Gimp users?

TIA
k02f@videotron.ca

The original (including needs) script structure -------------------------------------------------------------- #!/usr/local/bin/perl
print"Content-type:text/html\n\n";
print"";
&dothings;
#nocando
#&dosomeGimpPerChance;
&dosomeotherthings;
print"";
exit;
sub dothings {
blah... blah
}
#sub dosomeGimpPerChance {
# blah... blah
#}
sub dosomeotherthings {
blah... blah
}

The standalone script structure -------------------------------------------------------------- #!/usr/local/bin/perl
use Gimp qw (:auto);
use Gimp::Fu;
use Gimp::Util;
#Gimp::set_trace(TRACE_ALL);
register "", "", "", "", "", "", "", "*", "", \&doit;
exit main();
sub doit{
blah.. NO show, only load, change & save. }
$final=gimp_image_flatten($image); file_png_save($image, $final, $targp, $targp, 0,9,0,0,0,0,0); return ();
}
--------------------------------------------------------------

Marc) (A.) (Lehmann
2002-04-19 19:06:42 UTC (over 19 years ago)

Scripted Gimp Protocol 1 error

On Wed, Apr 17, 2002 at 12:03:14AM +0000, As Signed wrote:

Could anyone please help me get a perl script invoked from HTML via the local server run Gimp?

Run the script with -v to see gimp's error message. Protocol error 1 most probably means that gimp couldn't start. Most probably you don't have a valid DISPLAY in your environment.

Gtk-WARNING **: cannot open display:

Looks very much so. Set DISPLAY to a valid display and gimp will start.

... the above 2 are less valuable as I DON'T want display.

Well, but gimp does ;)

Guillermo S. Romero / Familia Romero
2002-04-19 20:44:55 UTC (over 19 years ago)

Scripted Gimp Protocol 1 error

pcg@goof.com (2002-04-19 at 1906.42 +0200):

... the above 2 are less valuable as I DON'T want display.

Well, but gimp does ;)

AKA it needs a VNC display or a Xvfb to be happy (it is not so hard to get one of those), and that is a must in 1.2. :]

GSR

Jeff Trefftzs
2002-04-22 06:04:26 UTC (over 19 years ago)

Scripted Gimp Protocol 1 error

Regarding gimp-1.3.5 -- This is the highly unstable, incomplete, developers' version, and is not guaranteed to even compile (although I think it does, if all the right libs are available). But don't even think of using it now for production work. Who knows what can still change.

Everything you've posted suggests strongly that your problems lie with Apache or some permission conflicts, rather than with the Gimp itself. Have you tried starting the gimp first, and firing up its perl server (Toolbox/Xtns/Perl/Server)? At least then you know you have a running gimp.

Good luck,

As Signed
2002-04-22 09:15:13 UTC (over 19 years ago)

Scripted Gimp Protocol 1 error

On Friday 19 April 2002 17:06, you wrote:

On Wed, Apr 17, 2002 at 12:03:14AM +0000, As Signed

wrote:

Could anyone please help me get a perl script invoked from HTML via the local server run Gimp?

Run the script with -v to see gimp's error message. Protocol error 1 most probably means that gimp couldn't start. Most probably you don't have a valid DISPLAY in your environment.

Gtk-WARNING **: cannot open display:

Looks very much so. Set DISPLAY to a valid display and gimp will start.

... the above 2 are less valuable as I DON'T want display.

Well, but gimp does ;)

Thanks for the rsponse.

I had since then posted to comp.graphics.apps.gimp
and got much the same advice. I installed Xvfb and think I got it running but it did not help. I also got a bash script to run a Script-Fu I threw together but found myself back with the same protocol error when I tried to get that bash to run from an HTM page though it wasn't exactly what I wanted (Script-Fu, Perl-Fu nocando).

So I thought why don't I just install Gimp 1.3.5 which also went fairly well right up to the point of trying to install Pango or whatever which gave me nothing BUT error messages.

I GAVE UP and created a KDE menu item to run my standalone perl script. Now when I run the primary perl script from an HTM page it writes a data file on the first run and then fails to load an image yet to be created. I then run the standalone perl script via the menu entry (or shell) and that gets Gimp to do its thing with the data. Then I run the main script again and it loads the created image. In short 3 clicks instead of 1.

I hope that 1.3.5 will soon be a part of a SuSE distribution and maybe then I'll take another shot at embedding the standalone into the primary script. For now I just can't afford to be chasing rainbows. My programming is too limited, especially when it comes to figuring out why a standalone perl script that CAN and DOES get Gimp to compose an image and save it when run from shell cannot do the same (and no more) from an HTM page.

I don't need Gimp to feed the output to the calling script, just to save it to disk and the script can take it from there. Someone said on the ng long ago that this error was likely an Apache or HTTPD or Perl problem. I still wonder. Maybe it's just my perl sytax.