This entire script worked a few days ago, it uploaded the image and the thumbnails..but I tried to make it to only upload one thumbnail and I killed the script! lol.
Error:
I did a test print on $filename and you can see it prints out successfully before the script dies. So how can it say it's undefined?rock6.jpg Software error: Can't call method "Flatten" on an undefined value at uploadv25.pl line + 232.
The following preceeds the rest of the code above, this is what I'm using to upload the entire image itself to the server before ImageMagick is used. Remember, this DOES work and files DO upload.print $filename; $localfile = $filename; $localfile =~ m/(.*)\.(.*)/; $newfilename = "$thumbdir/$1.png"; my ($image, $x); $image=Image::Magick->new; $image->BlobToImage($localfile); $image = $image->[0]; $image->Flatten(); #$x = $image->Read($localfile); warn "$image" if "$image"; $x = $image->Resize(width=>100, height=>100); $x = $image->Write($newfilename); warn "$x" if "$x";
Thanks for your help!open( SAVED, ">>$localfile" ); # || die $!; while ( $bytesread = read( $remotefile, $buffer, 1024 ) ) { print SAVED $buffer; } close SAVED;
In reply to Re: Re: Saving the first frame of any image
by coldfingertips
in thread Saving the first frame of any image
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |