Page 1 of 1

setting resize by height - upload class

Posted: Mon Dec 19, 2011 7:39 pm
by robg1981
Hi

Just wondering how you go about setting resize by height.

to resize by width i know its:

[syntax=php]$upload->save_image_resized('../folder/' . $upload->name, 800);[/syntax]

how do you go about resizing by height.

For instance the width doesnt matter on website, but the hight should not exceed 400px.

Re: setting resize by height - upload class

Posted: Wed Dec 21, 2011 12:43 am
by jacek
You can specify 0 for either dimension to have it calculated based on the other one. So to do what you are trying to you would want to use

[syntax=php] $upload->save_image_resized('../folder/' . $upload->name, 0, 800);[/syntax]

Re: setting resize by height - upload class

Posted: Wed Dec 21, 2011 8:41 am
by robg1981
Thanks :)