Saimagedisplayer - Retain Proportions?

Hi all,

I’ve just installed the extension image-displayer (SAimagedisplayer). It works fine, but I want the option to retain the proportions of the image when it’s resized. At the moment it is distorting the image by making it fit the size I specify exactly, when I would prefer to be able to specify that it should retain proportions and use those sizes as a max, OR let me specify that I would like it to crop the image so it fills that area. I’ve used a similar extension in Wordpress that does what I want, so I’m sure Yii has something even better!

Does this image-display extension do that, or is there a more configurable image resizer around?

Thanks for your help.


SAImageDisplayer extension is using the image extension to resize images:

$image->resize($this->_width, $this->_height);

As you can see in the documentation about the resize method from the image extension:

As we do not specify that the ratio doesn’t need to be maintained, the resizing in SAImageDisplayer will keep the ratio.

If you need it I could add the option to choose the ratio between:

  • Don’t keep the ratio

  • Resize original image to Height of x pixels, using height to maintain aspect ratio.

  • Resize original image to Width of x pixels, using width to maintain aspect ratio.

  • Resize original image using automatic aspect ratio calculation

Source: Image Documentation