Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Hi,
I am having a few problems with the following:
the correct filenames are being written to the new directry images_small but the files are empty?use Image::Magick; @dir_names = ("images_small"); opendir(DIR,"output_gif"); foreach (readdir(DIR)) { /^(\d+).*/; $filename = $1; push @file_convert, $filename; } opendir (DIR, "output_gif") or die "$!"; foreach $dir_name (@dir_names) { foreach $file (<@file_convert>) { $filename_orig = "output_gif\/$file.gif"; print "\tOrig = $filename_orig"; $filename_new = "$dir_name\/" . $file . ".gif"; $image = Image::Magick->new; open (IMAGE, "$filename_orig") or die "$!"; $image->Read(file=>\*IMAGE); close (IMAGE); $image->Resize(geometry=>"12.5%"); $image->Trim; $image->Set(page=> '+0,+0'); open (IMAGE2, ">$filename_new") or die "$!"; $image->Write(file=>\*IMAGE2, filename=>$filename_new); close (IMAGE2); } }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: resize gif using ImageMagick
by zentara (Archbishop) on Aug 04, 2005 at 12:02 UTC | |
by Anonymous Monk on Aug 04, 2005 at 13:03 UTC | |
Re: resize gif using ImageMagick
by Jaap (Curate) on Aug 04, 2005 at 11:50 UTC | |
by Anonymous Monk on Aug 04, 2005 at 11:55 UTC | |
by Jaap (Curate) on Aug 04, 2005 at 12:05 UTC |
Back to
Seekers of Perl Wisdom