Hi,
I am trying to obtain the height and width for an image from another server before it is loaded for the user. This is for an shopping site and images over 300 width mess the page up, so I want to add the height & width tags to anything larger than 300px wide.
I am trying to use Image::Size; but it's not giving me any results. Here is my test script:
Like I said, I am not getting any results - I get a blank page. Also - this server is not dedicated (shared), and the script will be called on quite often - do I have to worry about resource usage should I get this working?
Thanks for any input.
I am trying to obtain the height and width for an image from another server before it is loaded for the user. This is for an shopping site and images over 300 width mess the page up, so I want to add the height & width tags to anything larger than 300px wide.
I am trying to use Image::Size; but it's not giving me any results. Here is my test script:
Code:
#!/usr/bin/perl
use CGI::Carp qw(fatalsToBrowser);
use Image::Size;
print "Content-type: text/html\n\n";
$IMAGRUL = "[URL unfurl="true"]http://domain.com/images/imagename.jpg";[/URL]
my ($IMG_WIDTH, $IMG_HEIGHT) = imgsize("$IMAGRUL");
print "$IMG_WIDTH $IMG_HEIGHT";
exit;
Like I said, I am not getting any results - I get a blank page. Also - this server is not dedicated (shared), and the script will be called on quite often - do I have to worry about resource usage should I get this working?
Thanks for any input.