jonnyfolk has asked for the wisdom of the Perl Monks concerning the following question:
I've been messing around with this for ages now without finding a solution - I am taking a set of images from the internet and printing a thumbnail to my server. However when I run the script only a haphazard subset of the full set is written to file - I have to run the script a few times to get all the images
Could anyone test this to see if it an error in the code or otherwise what might be going wrong? Thanks.
Additional note: All of the lines are printed, 1 to 8, but some of the 'Write' are ignored, as mentioned previously, in haphazard manner.#!/usr/bin/perl -w use strict; use Image::Magick; use CGI::Carp qw(fatalsToBrowser warningsToBrowser); print "Content-type: text/html\n\n"; my @names = qw( http://www.coldwellbanker.com/imgs/property2002/205/14692047_1.jpg.266 +x200 http://www.coldwellbanker.com/imgs/property2002/78/14692047_2.jpg.266x +200 http://www.coldwellbanker.com/imgs/property2002/463/14692047_3.jpg.266 +x200 http://www.coldwellbanker.com/imgs/property2002/336/14692047_4.jpg.266 +x200 http://www.coldwellbanker.com/imgs/property2002/209/14692047_5.jpg.266 +x200 http://www.coldwellbanker.com/imgs/property2002/82/14692047_6.jpg.266x +200 http://www.coldwellbanker.com/imgs/property2002/467/14692047_7.jpg.266 +x200 http://www.coldwellbanker.com/imgs/property2002/340/14692047_8.jpg.266 +x200 ); 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 = $image->Write($photo); print qq~<img src="http://www.mysite.com/$photo"><br>~; } exit();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Image::Magick not printing all images
by almut (Canon) on Dec 31, 2008 at 00:39 UTC | |
|
Re: Image::Magick not printing all images
by oko1 (Deacon) on Dec 31, 2008 at 02:15 UTC | |
|
Re: Image::Magick not printing all images
by leocharre (Priest) on Dec 31, 2008 at 01:13 UTC | |
|
Re: Image::Magick not printing all images
by zentara (Cardinal) on Dec 31, 2008 at 10:46 UTC |