setting resize by height - upload class

Any problems relating to the premium downloads should go in here
Post Reply
robg1981
Posts: 13
Joined: Fri Dec 16, 2011 8:54 am

setting resize by height - upload class

Post 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.
User avatar
jacek
Site Admin
Posts: 3262
Joined: Thu May 05, 2011 1:45 pm
Location: UK
Contact:

Re: setting resize by height - upload class

Post 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]
Image
robg1981
Posts: 13
Joined: Fri Dec 16, 2011 8:54 am

Re: setting resize by height - upload class

Post by robg1981 »

Thanks :)
Post Reply