Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Re: Re: Resizing images without Image::Magick

by xtype (Deacon)
on Aug 25, 2002 at 20:44 UTC ( [id://192718]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Resizing images without Image::Magick
in thread Resizing images without Image::Magick

Ack!
No, that is no longer the case.
Please see: Re: Re: Resizing an image with perl.

I was going to post code, but silent11's is nearly identical to mine.
So instead I will post this and you can see GD create true color images.
:^)
http://www.xtype.org/albums/photo.cgi?img=01368&size=640x480

Ciao, -xtype

PS. note the slight difference when creating a new image?
sub resize { use GD; my($data, @size) = @_; my $image = GD::Image->newFromJpegData($data, 1); my @isize = $image->getBounds(); my $new_image = GD::Image->new(@size, 1); $new_image->copyResampled($image,0,0,0,0,@size,@isize); return $new_image->jpeg(75); }
http://search.cpan.org/author/LDS/GD-2.01/GD.pm if you need help.

Replies are listed 'Best First'.
Re: Re: Re: Re: Resizing images without Image::Magick
by waswas-fng (Curate) on Aug 25, 2002 at 21:02 UTC
    do some limit checking on that cgi =)
    http://www.xtype.org/albums/photo.cgi?img=01368&size=999999999999999x9999999999999999
    


    -Waswas
      Indeed.
      Although, it was for personal use, made 755 just for the benefit of this thread. :^)
      If you have time to wait around for a 9999x9999 jpg to download, then be my guest, because it really does not take much CPU on the server send. That is the beauty of using gd, and just another benefit GD has over Image::Magick.

      I suppose, for image quality reasons it could be limited to 3 or 4 times the natural size.
      Bah! It spits out my thumbnails damn fast, that is all I care for now.
      photo.cgi?img=01368 (natural size (GD isn't /use/d))
      photo.cgi?img=01368&thumb (keeps image proportion, and size under 120x90)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://192718]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (8)
As of 2024-04-19 08:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found