Beefy Boxes and Bandwidth Generously Provided by pair Networks Bob
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Manipulating Images (height and width)

by Anonymous Monk
on Sep 09, 2002 at 08:06 UTC ( [id://196221]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to Manipulating Images (height and width)

Well, I use Image::Magick for that
Example:
my $thumb= new Image::Magick; open(IMAGE, "</path/$photof"); $thumb->Read(file=>\*IMAGE); close(IMAGE); $thumb->Resize(geometry=>'120X90'); $thumb->Write("/path/thumb_$photof");

Of course, what is missing in there for your usage is simply a:
my ($height,$width) = $thumb->Get('width','height);

before the resize, and add there your checks.
(the last part is untested).

Michalis

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://196221]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.