Hah, I had the exact same task a few days ago. I ended up using Graphics::Magick to resize and then DBI to insert the locations of both the thumbnail and original along with general information about the original picture. Unfortunately for you, however, this here program is not on the computer I am using.

The reason I used Graphics::Magick instead of Image::Magick is because I got tired of trying to install the latter after two days. I think the commands are the same, though. It went something like:

sub thumbnailize { my ($pic, $thumb) = @_; my $image = Graphics::Magick->new; my $err; $err = $image->Read($pic); warn $err if $err; $err = $image->Scale(geometry => '200x200'); warn $err if $err; $err = $image->Write($thumb); warn $err if $err; }

Pretty simple after reading the documentation. :)

And you didn't even know bears could type.


In reply to Re: Upload with image resizing by Image::Magick by Lawliet
in thread Upload with image resizing by Image::Magick by TWValentine

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.