Welcome Guest, Not a member yet? Register   Sign In
Smart thumbnail - RESOLVED
#1

[eluser]bapobap[/eluser]
Hope someone can help!

I'm allowing users to upload an image, which I then process to make into a lovely profile avatar, dimensions exactly 120x120.

I'd like to keep the scale correct as best I can, so I need to do two steps, scale it, then crop it.

If I scale a portrait photo, I get 120x160 (fine). If I scale a landscape, 120x90 (not so fine).

Is there someway to scale the image to bring either of the dimensions down but never over the 120 boundary? In the case of the landscape photo, if I change the config settings from 120 to 160, the result becomes 160x120, so that's fine to crop down to 120x120. Using the master dimension var is helpful but I need to know what layout the image is first, right?

1st question: Is there a smarter way of doing this than trying to detect if the image is a portrait or landscape?
2nd question: Is there a smart way to work out how to crop the image after scaling it?

I feel I might be dreaming up over-complicated ways of solving the problem, any help is appreciated!

EDIT: http://ellislab.com/forums/viewthread/75715/ - solved my problem




Theme © iAndrew 2016 - Forum software by © MyBB