Image Scaling within Limits (max height, max width)


/ Published in: PHP
Save to your folder(s)

This is a much cleaner way to do this than the number of examples on the web. Every example I saw seemed to account for orientation - horizontal vs. vertical vs. square when looking at the input. This ignores horizontal and vertical by mapping the "long side" and "short side" and then re-mapping the variables to $h / $w at the end.

URL: http://davesthings.posterous.com/im-feeling-brilliant

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.