ruzam has asked for the wisdom of the Perl Monks concerning the following question:
Is this an Image::Magick bug? Can I force Image::Magick to use ram instead of creating tmp file handles? What if anything can I do to get this example to stop failing?Image Magick(1016) Read failed: Exception 430: unable to create tempor +ary file `/home/user/tmp/magick-XX376BF8': Too many open files
use strict; use warnings; use Image::Magick; my $image_count = 0; # provide your own test paths for these! my $src_dir = '/some/source/directory/containing/a/.pic/file'; my $dest_dir = '/some/temp/directory'; my $file = 'somepicfilename'; while (1) { convert("$src_dir/$file.pic", $dest_dir, "$file.jpg"); } sub convert { my ($src, $dest, $filename) = @_; my $image = Image::Magick->new; $image_count++; my $x = $image->Read($src); die "Image Magick($image_count) Read failed: $x\n" if $x; $x = $image->Set(quality=>'85') and die "Image Magick($image_count) Set1 failed: $x\n"; $x = $image->Write("$dest/$filename") and die "Image Magick($image_count) Write1 failed: $x\n"; #172x228 $x = $image->Crop(geometry=>'120x159+26+15') and die "Image Magick($image_count) Crop1 failed: $x\n"; $x = $image->Thumbnail(width=>86, height=>114) and die "Image Magick($image_count) Thumbnail1 failed: $x\n"; $x = $image->Set(quality=>'75') and die "Image Magick($image_count) Set2 failed: $x\n"; $x = $image->Write("$dest/thumb.$filename") and die "Image Magick($image_count) Write2 failed: $x\n"; $x = $image->Crop(geometry=>'75x90+27+25') and die "Image Magick($image_count) Crop2 failed: $x\n"; $x = $image->Thumbnail(width=>29, height=>38) and die "Image Magick($image_count) Thumbnail2 failed: $x\n"; $x = $image->Write("$dest/stamp.$filename") and die "Image Magick($image_count) Write3 failed: $x\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Image::Magick Exception 430
by snoopy (Curate) on Nov 05, 2007 at 00:24 UTC | |
by ruzam (Curate) on Nov 05, 2007 at 16:25 UTC | |
by snoopy (Curate) on Nov 06, 2007 at 23:20 UTC | |
|
Re: Image::Magick Exception 430
by ruzam (Curate) on Nov 04, 2007 at 16:08 UTC |