The script below, called wallace.pl, executes fine when I execute it at
the command line, but dies when I try to call it from my web browser.
##
Here is there error it gives when it dies:
wallace.pl: protocol error (1) at
/usr/lib/perl5/site_perl/5.6.0/i386-linux/Gimp/Net.pm line 66. (ERROR)
##
Here is the script:
#!/usr/bin/perl
#
use Gimp qw(:auto );
use Gimp::Fu;
Gimp::set_trace(TRACE_ALL);
my $imageurl = "/images/";
my $filename = "/home/swamp/html/images/";
$imageurl =~ s/^(.*)\/(.*)$/$1\/backtest/g;
$filename =~ s/^(.*)\/(.*)$/$1\/backtest/g;
print STDERR "[wallace.pl] About ready to call register\n";
register(
"test_background",
"Test an image as a background in a web browser.",
"Test an image as a background in a web browser.
Requires and Indexed color image",
"SPW",
"(c) 1999 SPW",
"1999-02-20",
"/Xtns/Web Graphics/Test As Background",
"INDEXED*",
[],
\&test_background
);
print "Content-type: text/html\n\n";
print qq(
Hi Everybody!
);
sub test_background {
print STDERR "[wallace.pl] Start test_background\n";
my $size = 100;
my $color = [127, 255, 0];
my $img = Gimp->image_new ($size, $size, RGB);
# Create a new layer
$layer = Gimp->gimp_layer_new($img, $size, $size, RGB,
"Layer 1", 100, NORMAL_MODE);
# add the layer to the image
Gimp->gimp_image_add_layer($img, $layer, -1);
# Set the background to the required color
Gimp->gimp_palette_set_background($color);
# Paint the layer
Gimp->gimp_edit_fill($layer);
# Get the image's drawable
my $drawable = Gimp->gimp_image_active_drawable($img);
# Add text to the background
Gimp->gimp_text($img,
$drawable,
1,
1,
"Hello",
0,
1,
12,
0,
"*",
"courier",
"*",
"*",
"*",
"*");
# Convert the image to indexed just make sure
Gimp->gimp_convert_indexed($img, 0, $size);
Gimp->file_gif_save(RUN_NONINTERACTIVE,
$img,
$drawable,
"$filename.gif",
"$filename.gif",
0, 0, 0, 0);
print STDERR "[wallace.pl] Just finished saving $filename.gif\n";
#open O, ">$filename.html";
#print O qq(
#
#
# This is how the image looks as a background pattern.
#
# );
#my $url = "$file:$filename.html";
#eval( "extension_web_browser", 1, $url, 0);
return ();
}
exit main;
Darian-- [EMAIL PROTECTED] | http://www.studentssharing.org
Ralph Nader for President http://www.votenader.org