Answer by Mitchell McKenna for Codeigniter not maintaining aspect ratio

September 12 2010, 10:45pm

Correct, you MUST specify both height and width. Since the maintain_ratio option is enabled, the resize will be as close to the target size as possible while preserving the original aspect ratio.

However, if you want to make sure it's always a certain height, set the master_dim config option to 'height', then you can set width to anything and it will always make the resize image that height while maintaining aspect ratio with the width. Similar idea works to maintain width.