Page 1 of 1

Image aspect ratio

PostPosted: 25 Mar 2013, 19:52
by oaao
Is there any way to force an aspect ratio for thumbnails? It would naturally have to crop some images, but when uploading an image that's vertically tall vs images that are horizontally long, the thumbnails have many different sizes in the search results screens.

Re: Image aspect ratio

PostPosted: 25 Mar 2013, 20:06
by oaao
Fixed this for now by making large thumbnails, changing this:

Code: Select all

class Images extends ParentModel 
{
       const KEEP_THUMB_PROPORTIONAL = false;
 

protected/modules/images/models/Images.php

and setting overflow: hidden on the image container.

Re: Image aspect ratio

PostPosted: 05 Apr 2013, 16:46
by oaao
Better method:

Code: Select all

    public static function createThumb
($image, $width, $height){
            $thumb->adaptiveThumb($width, $height)
 


http://github.com/tokolist/yii-componen ... ive-thumbs