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"; }

In reply to Re^2: Thumbnails and Filehandles by thekestrel
in thread Thumbnails and Filehandles by thekestrel

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.