Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

uploaded Image::Info, not working

Status
Not open for further replies.

MysticFallout

Technical User
Sep 21, 2002
14
US
hi, i just uploaded Image::Info to my lib dir (not the regular dirs in @INC). my server doesnt have this module. and i try to run a simple script, but i get this error:

Undefined subroutine &main::image_info called at img.cgi line 17.

not sure why either. (ive never done this, always used installed modules). my script is below. comments on my horrible coding is welcome :D lol

Code:
#!/usr/bin/perl -w

BEGIN {
$| = 1;
open (STDERR, ">&STDOUT");
print "Content-type: text/plain\n\n";
}

require '/home/path/to/the/module/scripts/lib/Image/Info.pm';

use strict;

use CGI qw/:all/;

my $img_url = param('img_url') || "paper-04.jpg";

my $img = image_info($img_url);

my ($img_height, $img_width) = dim($img);

my $img_ext = $img->{file_ext};

my $nl = "\n\r";

print "Height: $img_height" . $nl;

print "Width: $img_width" . $nl;

print "File Extension: $img_ext";

exit(0);
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top