in reply to Re: Thumbnails and Filehandles
in thread Thumbnails and Filehandles

Holli,
Thanks for the feedback. When I need to then write the data back out (i.e. just send the raw image to a database) how do I get a hold of it, is it possible to use the $image->Write???

Regards Paul.

Update: I can't seem to get the method you use of passing the filehandle ($fh) to 'Read' to work. I added a little to the script you made so it should print the raw data to the screen when viewed via a browser...
#!/usr/bin/perl use strict; use warnings; use Image::Magick; use CGI qw/:standard/; my $cgi = new CGI; my $file = $cgi->param('image'); if ( !$file ) { print header,start_multipart_form(), filefield('image',50,80), submit(-name=>'upload', -value=>'Upload'), end_form(); } else { print header; print "<br>FILE: $file\n"; my $image = Image::Magick->new; my $fh = upload('image'); $image->Read(file=>$fh); my $big_image = $image->ImageToBlob(); print "<br>DATA: $big_image\n"; }