thekestrel has asked for the wisdom of the Perl Monks concerning the following question:
... my $fh = upload('image'); if ( !$cover_image && cgi_error ) { print header(-status=>cgi_error); } my $image; while (<$fh>) { $image .=$_; } my $num = insert_image_db($dbh, $user, $type, $image_title, $image); ...
#!/usr/bin/perl use strict; use warnings; use Image::Magick; my $image = Image::Magick->new; open (IMAGE, 'xyz.jpg'); $image->Read(file=>\*IMAGE); close(IMAGE); $image->Thumbnail(geometry=>'150x150'); $image->Write(filename=>'xyz2.jpg');
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Thumbnails and Filehandles
by holli (Abbot) on Jul 10, 2005 at 06:28 UTC | |
by thekestrel (Friar) on Jul 10, 2005 at 17:54 UTC | |
|
Re: Thumbnails and Filehandles
by zentara (Cardinal) on Jul 10, 2005 at 10:51 UTC | |
by davidrw (Prior) on Jul 10, 2005 at 11:32 UTC |