On our our server we were using NETPGM to resize images. Unfortunately, this isn't working anymore and now I am looking for a way to resize images when they are uploaded. Any help or suggestions would be greatly appreciated. Here is the current code:
$ENV{PATH} .= ":/home/antiques/public_html/netpbm"; $pnmscale = "/home/antiques/public_html/netpbm/pnmscale"; $giftopnm = "/home/antiques/public_html/netpbm/giftopnm"; $ppmtogif = "/home/antiques/public_html/netpbm/ppmtogif"; if ($filetype eq 'jpg') { ## THIS WILL RESIZE DISPLAY TO A THUMBNAIL my @fileparts = split(/\./, $Filename); my $outfile = $fileparts[0] . "-T." . $fileparts[1]; #IMAG +E FACTOR: -ysize $thumbnail_height -xsize $thumbnail_width #cjpeg -qu +altiy 5-95 optional quality ###### NETPBM THUMB CALL ##### system("djpeg $SAVE_DIRECTORY\/$Filename | $pnmscale -xsi +ze $thumbnail_width | cjpeg -quality 95 > $SAVE_DIRECTORY\/$item_id\ +_$outfile"); ###### IMAGEMAGIK THUMB CALL ##### #system("convert -sample x75 $SAVE_DIRECTORY\/$Filename $S +AVE_DIRECTORY\/$item_id\_$outfile"); ## THIS WILL RESIZE TO A DISPLAY IMAGE my @fileparts2 = split(/\./, $Filename); my $outfile2 = $fileparts2[0] . "-L." . $fileparts2[1]; #I +MAGE FACTOR: -ysize $thumbnail_height -xsize $thumbnail_width ###### NETPBM DISPLAY CALL ##### system("djpeg $SAVE_DIRECTORY\/$Filename | $pnmscale -xsiz +e $display_width | cjpeg > $SAVE_DIRECTORY\/$item_id\_$outfile2"); ###### IMAGEMAGIK DISPLAY CALL ##### #system("convert -sample x240 $SAVE_DIRECTORY\/$Filename $ +SAVE_DIRECTORY\/$item_id\_$outfile2"); {system("mv $SAVE_DIRECTORY\/$item_id\_$outfile2 $SAVE_DIR +ECTORY\/$item_id\_$Filename");} {system("rm $SAVE_DIRECTORY\/$Filename");} }

In reply to Image Resizing Help by koacamper1

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.