I'm a novice Perl user trying to get the width and height attributes of some Jpegs. I found this demo site with the following code:
#!/usr/bin/perl -w
use strict;
use Image::Size;
# Just fetch the size
my ($size_x, $size_y) = Image::Size::imgsize("test.jpg"
;
print "Image is: $size_y x $size_x (height x width)\n";
# HTML-friendly format
my $size = Image::Size::html_imgsize("test.jpg"
;
print "Here is my image <img src=\"test.jpg\" $size>\n";
exit();
At first I put the code in my actual program, and I got nothing but:
Image is: x (height x width)
Then I took the above example and changed the test.jpg to a known path to a jpeg file. First I got a 500 error, and then I added:
print "Content-type:text/html\n\n";
and again all I got was:
Image is: x (height x width)
The path to the jpeg is 100% correct, and I checked our Perl modules on the server and it lists Image::Size as being there.
Any ideas?
Thanks
Sam
#!/usr/bin/perl -w
use strict;
use Image::Size;
# Just fetch the size
my ($size_x, $size_y) = Image::Size::imgsize("test.jpg"
print "Image is: $size_y x $size_x (height x width)\n";
# HTML-friendly format
my $size = Image::Size::html_imgsize("test.jpg"
print "Here is my image <img src=\"test.jpg\" $size>\n";
exit();
At first I put the code in my actual program, and I got nothing but:
Image is: x (height x width)
Then I took the above example and changed the test.jpg to a known path to a jpeg file. First I got a 500 error, and then I added:
print "Content-type:text/html\n\n";
and again all I got was:
Image is: x (height x width)
The path to the jpeg is 100% correct, and I checked our Perl modules on the server and it lists Image::Size as being there.
Any ideas?
Thanks
Sam