(none) imager-devel
/ help / lists / applications / search /
 

Re: Resizing a jpg file

From: gak (
03656@xyz.molar.is)
Date: Tue 20 Nov 2001 - 16:01:01 UTC

  • Next message: Arnar Mar Hrafnkelsson: "Re: Re: Resizing a jpg file"

    A follow-up to my previous message. Discovered that
    the 'write' error is because the 'open' command it
    failing. Opening a gif or jpg produces the error
    message 'failed: format not supported'. Does this
    indicate a host installation problem.

    Greg

    --- gak <03656@xyz.molar.is> wrote:
    > The capabilities of Imager are very exciting. We
    > look
    > forward to putting them to use. Tried the brief
    > script shown at the top of the documentation, but
    > I'm
    > getting an error:
    >
    > "Can't call method 'write' on an undefined value.."
    >
    > It then references the scaled write command. Here
    > is
    > the code. What am I missing?
    >
    > #!/usr/bin/perl
    > use CGI;
    > use CGI::Carp qw/fatalsToBrowser/;
    >
    > use Imager qw(init);
    >
    > init();
    >
    > $img=Imager->new();
    > $img->open(file=>'727_orig.jpg',type=>'jpeg')
    > || print "failed: ",$img->{ERRSTR},"\n";
    > $scaled=$img->scale(xpixels=>400,ypixels=>400);
    > $scaled->write(file=>'727.jpg',type=>'jpeg')
    > || print "failed: ",$scaled->{ERRSTR},"\n";
    >
    > print "Content-type: text/html\n\n";
    > print "
    > <html><head>
    > <title>Done</title></head>
    > <body>
    > The file has been resized.
    > </body></html>
    > ";
    >
    > THANKS!
    >
    > __________________________________________________
    > Do You Yahoo!?
    > Yahoo! GeoCities - quick and easy web site hosting,
    > just $8.95/month.
    > http://geocities.yahoo.com/ps/info1
    >

    __________________________________________________
    Do You Yahoo!?
    Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month.
    http://geocities.yahoo.com/ps/info1



  •