how do i resize based on landscape or portrait?

See all posts Reply

how do i resize based on landscape or portrait? new!
by sarmen, 13 years, 2 months ago
how can i detect if the image uploaded is landscape or portrait?

what i want to do is if the image has a height larger than the width (meaning portrait)
i want to crop the width at 400px and height on auto.

then if the width is bigger than the height, to do 400 on height and width auto.Reply
Re: how do i resize based on landscape or portrait? new!
by sarmen, 13 years, 2 months ago
nm, i found out.
for whoever else is wondering.
if($handle->image_src_x > $handle->image_src_y) {.... } //this means landscape
if($handle->image_src_x < $handle->image_src_y)  {..... } //this means portrait
Reply