in reply to Image::Magick not printing all images
Yes, as almut mentioned very wisely..
I know Image::Magick is funny- some of the methods only return if there's an error. Ala unix.
This is a little of the frustration of mixing c coders with perl code :-)
So, those $x hold the error, if there is one.. so..
my $count; foreach my $item (@names) { $count++; my $photo = '../photo' . $count . '.jpg'; my $image = Image::Magick->new(magick=>'JPEG'); my $x = $image->Read($item); $x = $image->Scale(width=>'50', height=> '50'); $x and die("Error scaling: $x"); $x = $image->Write($photo); $x and die("Error writing: $x"); print qq~<img src="http://www.mysite.com/$photo"><br>~; }
|
|---|