cidaris has asked for the wisdom of the Perl Monks concerning the following question:
where the arguments change for every link.<img src="cgi-bin/image_serve.cgi?full+124236+pc_img1">
Anything glaring I'm missing, or is the problem on the server or client end, and not Perl's problem?#!/usr/bin/perl BEGIN { $|=1; use CGI::Carp('fatalsToBrowser'); } use CGI qw(:all); use DBI; use DBD::mysql; use Image::Magick; my $database = "###"; my $username = "###"; my $password = "###"; my $hostname = "###"; my $tbl = "listings"; my $query = new CGI; my $location = $ARGV[0]; my $mls_id = $ARGV[1]; my $img = $ARGV[2]; my $dbh = DBI->connect("DBI:mysql:$database:$hostname",$username,$pass +word) or die "Unable to connect to listings Database: $DBI::errstr\n" +; my $sql = "SELECT $img FROM listings WHERE pc_mls_id = $mls_id"; my $sth = $dbh->prepare($sql) or die "Couldn't prepare: $DBI::errstr\n +"; $sth->execute; my $ref = $sth->fetchrow_hashref; my $raw_img_data = $$ref{$img}; $sth->finish; $dbh->disconnect; my $image = Image::Magick->new; open(IMAGE, $raw_img_data); $image->Read(file=>\*IMAGE); close(IMAGE); my ($x,$y); if ($location eq "detailed"){ $x = 250; $y = 226; } if ($location eq "med"){ $x = 150; $y = 113; } if ($location eq "small"){ $x = 75; $y = 57; } $image->Resize(width=>$x,height=>$y); print "Content-type: image/jpeg\n\n"; $image->Write('jpg:-');
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Multiple Script calls
by Zaxo (Archbishop) on Feb 11, 2003 at 00:02 UTC | |
by cidaris (Friar) on Feb 11, 2003 at 02:22 UTC | |
|
Re: Multiple Script calls
by cees (Curate) on Feb 11, 2003 at 02:35 UTC | |
by cidaris (Friar) on Feb 11, 2003 at 02:38 UTC |