Is it possible to maintain image aspect ratio when scaling images?

The code of WordPress states that the fourth variable with the add_image_size() function is value for the crop ‘mode’.

If you that value to ‘false’ (which is default) it’ll keep the aspect ratio of your images.

For example, if you set height and width to both 150×150 and have an image that is 300×200 will become 225×150.

Source: http://codex.wordpress.org/Function_Reference/add_image_size

Leave a Comment