Phoenix.pm: Job (Sort of :) Fwd: looking for Perlmongers who can spare 5 mins

jim mckay jimm at amug.org
Tue Oct 10 21:27:47 CDT 2000


try Imager.pm

it supports jpeg, gif png... only thing is it crashes on corrupt files. You'll
need to install the libs for jpeg and gif.. here's some sample code..




#!/usr/bin/perl
use Imager;

my($in)=shift(@ARGV);
my($out)=shift(@ARGV);

for(@ARGV){
   if(/^(.*)=(.*)$/){
      $params{$1}=$2;
     }
   }


  $img = Imager->new();
  $img->open(file=>$in,type=>'jpeg');
  $scaled = $img->scale(%params);
  $scaled->write(file=>$out,type=>'jpeg');

  print "$out written successfuly\n";
   


-Jim


On 10/10/00 at 6:31 PM, Eden.Li at asu.edu (Eden Li) wrote:

> Here's a start, it does JPEG images..  it uses the GD library which is
> availible for most platforms.  Right now no gif support is included with
> GD, but there are certain current versions of GD that do GIFs.. i'm not
> sure Perl GD supports them :/... anyway it's attached, email me at
> Eden.Li at asu.edu if you need help with it.
> 
> Eden
> 
> Doug and Julie Miles <djmilesfamily at earthlink.net> wrote:
> > >I am looking for a script that is very similar to the PerlMagic Mogrify 
> > >tools, except that I can't install the ImageMagick program on the server 
> > >(NT server).  The script requirements are VERY simple:
> > >
> > >1. I want to pass a single image (jpeg or gif) at the command line to the 
> > >script (ie : img src="/cgi-bin/resize.cgi?betty.jpg">).  The original 
> > >image is either GIF or JPEG (I can run two different scripts if necessary 
> > >- resizegif.cgi and resizejpeg.cgi) and is a large image (<30K), but I 
> > >want that down to 2-4K.
> > >
> > >2. the script should simply take an image, resize it, and then display 
> > >it.  Ideally, the image should be within the boundaries of 120x120, or 
> > >even better be able to tell if the image is portrait, landscape or square, 
> > >and resize accordingly.  I have seen dozens of thumbnail gallery scripts, 
> > >but nothing that does something as basic as what I want.  All the other 
> > >scripts try to give me all sorts of HTML crap that I don't want.  I just 
> > >want to perform the resize on a single image!!!! so I can place my own 
> > >HREF tags around it!!!





More information about the Phoenix-pm mailing list