in reply to Re: Image::Magick resize question
in thread Image::Magick resize question
Even when I run this, the program does not die at the open command. If it did, I'd see my error message "Unable to open image: $!" somewhere in the script error message. That means the file is being opened correctly, right? The line that it complains about is the $image->Resize(geometry='450X300'); line. Am I doing something wrong there? Thanks for the response.sub convert_images { my ($array, $start_directory) = ($_[0], $_[1]); foreach my $picture (@$array) { # read the image via a filehandle my $image = Image::Magick->new; open(IMAGE, "<$start_directory\\$picture") || die "Unable to o +pen image: $!"; $image->Read(file=>\*IMAGE) || die "Unable to read image: $!"; close(IMAGE); # resize the image to the correct width and height $image->Resize(geometry=>'450X300') || die "Unable to resize i +mage: $!"; # write the image back to disk $image->Write(filename=>"$picture", compression=>'None') || di +e "Unable to write image: $!"; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
•Re: Re: Re: Image::Magick resize question
by merlyn (Sage) on Jun 08, 2002 at 14:17 UTC | |
|
Re: Re: Re: Image::Magick resize question
by mt2k (Hermit) on Jun 08, 2002 at 22:32 UTC | |
by Aristotle (Chancellor) on Jun 08, 2002 at 22:51 UTC | |
by emilford (Friar) on Jun 09, 2002 at 15:31 UTC | |
by Aristotle (Chancellor) on Jun 09, 2002 at 20:03 UTC |