Basically I want to make sure that images are no bigger than a certain size (width and height) and if they are bigger than scale them down.
My first attempt was to try to get the POST image to display simply as it is recieved. I tried;
Code: Select all
#!/usr/bin/perl
use strict;
use warnings;
use Image::Magick;
use CGI;
use CGI::Carp qw(fatalsToBrowser);
my $query = CGI->new;
my $image = Image::Magick->new;
my $filename = $query->param('uploadedfile');
my $status = $image->Read( $filename );
die "Couldn't open image: $status" if $status;
binmode STDOUT;
print $query->header( -type => "image/png" );
$image->Display();
Or do I simply have to save the file to the server first and then open it?