#!/usr/local/bin/perl5 push(@INC,"/home/www/flowerfire/cgi-bin/"); require("cgi-lib.pl"); # Get the CGI parameters ReadParse(); $url = $in{"url"}; $xscale = $in{"xscale"}; $yscale = $in{"yscale"}; $border = $in{"border"}; $cellspacing = $in{"cellspacing"}; $notopgrid = $in{"notopgrid"}; $compress = $in{"compress"}; # Generate the command line to generate the image table $commandline = "/usr/local/java/bin/java -classpath /usr/local/java/lib/classes.zip:/home/www/flowerfire/image2html Image2HTML -url $url -xscale $xscale -yscale $yscale -border $border -cellspacing $cellspacing -cgi -tableonly"; if ($compress eq "true") { $commandline .= " -compress"; } if ($notopgrid eq "true") { $commandline .= " -notopgrid"; } # set DISPLAY to :0 since FreeBSD java needs it (feh) $ENV{DISPLAY}=":0"; # Start running the command open (PROG, "$commandline |") || die "Can't run Image2HTML\n"; # Start the HTML page print PrintHeader(); print "\n"; print "
\n"; print "\n"; print "Please use your browser's Back command to return to the previous page, and try again.
\n"; print "\n"; exit(-1); } # If the table data is beginning, get out of this loop elsif (/TABLE_DATA_BEGIN/) { last; } # If this is the image width, remember it elsif (/IMAGE_WIDTH: (.*)$/) { $width = $1; } # If this is the image height, remember it elsif (/IMAGE_HEIGHT: (.*)$/) { $height = $1; } } # while PROG # Generate the parameters table print "Your Image2HTML parameters:
\n"; print "
| Image URL: | $url |
| Horizontal scaling factor: | $xscale |
| Vertical scaling factor: | $yscale |
| Border thinkness: | $border |
| Space between pixels: | $cellspacing |
| Compression: | $compress |
| No Top Grid: | $notopgrid |
\n"; print "Successfully fetched image from: $url:
\n"; print "
\n"; print "
| \n";
#print "Command line: $commandline \n";
print "\n";
while ( |
\n"; print "Total length of the HTML table: $totalchars characters
\n"; print "To use this table in another page, you can either save the HTML source code of\n"; print "this page fro your browser, or view the source code of this page, and copy/paste the table.
\n"; print "Back to the Use It Online page\n"; print "