Executing Gimp-Perl in CGI environment Follow Up!

2001-01-11 Thread Chris Hsiang



Now this is the 
error msg I am getting 
 
 
[Fri Jan 12 11:07:40 2001] [error] protocol error 
(1) at /usr/lib/perl5/site_perl/5.6.0/i386-linux/Gimp/Net.pm line 
66.
 
 
The following is the 
source code of my perl script
 

#! /usr/bin/perluse CGI;use strict;use 
Gimp;use Gimp::Net;Gimp::init;
my $q = new CGI;my $userdir = 
$q->param("userdir");my $tempdir = $q->param("tempdir");my 
$titletext = $q->param("titletext");my $menutext = 
$q->param("menutext");my $pagenumber = 
$q->param("pagenumber");
print "User Directory: ",  $userdir, 
 "\nTemplate Directory: ", $tempdir, "\nTitle Text: 
", $titletext, "\nMenu Text: 
", $menutext, "\nNo. of Pages: ", $pagenumber;
 my 
$file = "/sitemakerpro/template/chip/screenshot.jpg"; my $file1 = 
"/sitemakerpro/template/chip/screenshot1.jpg"; my $imgX; my 
$imgY; my  $img =  
Gimp->gimp_file_load(1,$file,$file); $imgX = 
Gimp->$img->width; $imgY = Gimp->$img->height; my 
$draw = 
Gimp->gimp_image_active_drawable($img); Gimp->$img->file_save 
($draw,$file1,$file1)


Re: executing gimp-perl in CGI environment

2001-01-11 Thread Marc Lehmann

On Thu, Jan 11, 2001 at 06:57:55AM -0600, Rick Bradley <[EMAIL PROTECTED]> wrote:
> > wallace.pl: protocol error (1) at
> > /usr/lib/perl5/site_perl/5.6.0/i386-linux/Gimp/Net.pm line 66. (ERROR)
> 
> The protocol error message makes me think you may not have a recent
> Gimp.  Fix the first problem and see if this error still persists.  If

This might be the case, but most often the problem is that there is no
connection or the connection gets closed immediately. Most often, this is
caused by not making a connection at all, for Apache::Registry, the usual way to do
that would be:

BEGIN { Gimp::init }

(in cgi you can do without the BEGIN {})

-- 
  -==- |
  ==-- _   |
  ---==---(_)__  __   __   Marc Lehmann  +--
  --==---/ / _ \/ // /\ \/ /   [EMAIL PROTECTED] |e|
  -=/_/_//_/\_,_/ /_/\_\   XX11-RIPE --+
The choice of a GNU generation   |
 |



Re: executing gimp-perl in CGI environment

2001-01-11 Thread Rick Bradley

* Chris Hsiang ([EMAIL PROTECTED]) [010111 06:47]:
> I've the following problem/question:
> 
> when I trying to to execute the gimp-perl scripts that I wrote from apache,
> I got the following error
> 
> [Fri Jan 12 02:05:50 2001] [error]
> Undefined subroutine
> &Apache::ROOT::index_2ecgi::gimp_file_load
> called at /var/www/html/index.cgi line 30.
> 
> or
> 
> wallace.pl: protocol error (1) at
> /usr/lib/perl5/site_perl/5.6.0/i386-linux/Gimp/Net.pm line 66. (ERROR)
> 
> or
> 
> [Fri Jan 12 02:41:50 2001] [error] Can't use an undefined value as a symbol
> reference at /usr/lib/perl5/site_perl/5.6.0/i386-linux/Gimp/Net.pm line 58
> 
> 
> how do I execute gimp-perl in an CGI environment?

Your problem is a perl problem (or an apache problem).  The first
error message shows that you have a scoping issue, as it is trying to
resolve the subroutine name gimp_file_load within the current package
(Apache::ROOT::index_2ecgi).  You either need to qualify your
subroutine call with a package (Gimp::...), do this indirectly with an
object created by the Gimp package ($image->...), or import the
subroutine symbols from the Gimp package (perhaps "use Gimp
qw(:auto);" will do what you want).

The protocol error message makes me think you may not have a recent
Gimp.  Fix the first problem and see if this error still persists.  If
it does and you're not using the newest Gimp then upgrade.

The third error, well, welcome to Perl ;) Seriously, fix the other
stuff first.  If the 3rd error still crops up you've (90% likely) got
your arguments list wrong.

Good luck.

roundeye
--
  Rick Bradley  http://www.roundeye.net



executing gimp-perl in CGI environment

2001-01-11 Thread Chris Hsiang

I've the following problem/question:

when I trying to to execute the gimp-perl scripts that I wrote from apache,
I got the following error

[Fri Jan 12 02:05:50 2001] [error]
Undefined subroutine
&Apache::ROOT::index_2ecgi::gimp_file_load
called at /var/www/html/index.cgi line 30.

or

wallace.pl: protocol error (1) at
/usr/lib/perl5/site_perl/5.6.0/i386-linux/Gimp/Net.pm line 66. (ERROR)

or

[Fri Jan 12 02:41:50 2001] [error] Can't use an undefined value as a symbol
reference at /usr/lib/perl5/site_perl/5.6.0/i386-linux/Gimp/Net.pm line 58


how do I execute gimp-perl in an CGI environment?