Image aspect ratio

Questions and answers about change of functions, design, hosting etc.

Moderators: Koduc, Xpycm

Forum rules
Pay attention! Forum is not a means for guaranteed support of clients and users. An answer as well as a quick answer is not supposed on the forum. We post messages as soon as possible.

The message limit on the forum is 3 messages per day.
If you want to say "thank you" then use the function "Give good reputation point", which is a green icon "plus" under the nickname of the person, who answered the message.

Image aspect ratio

Postby oaao » 25 Mar 2013, 19:52

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.
oaao
Stranger
 
Posts: 14
Joined: 24 Mar 2013, 00:08
Reputation point: 0

Re: Image aspect ratio

Postby oaao » 25 Mar 2013, 20:06

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.
oaao
Stranger
 
Posts: 14
Joined: 24 Mar 2013, 00:08
Reputation point: 0

Re: Image aspect ratio

Postby oaao » 05 Apr 2013, 16:46

Better method:

Code: Select all

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


http://github.com/tokolist/yii-componen ... ive-thumbs
oaao
Stranger
 
Posts: 14
Joined: 24 Mar 2013, 00:08
Reputation point: 0


Return to Questions and help for changes

Who is online

Users browsing this forum: No registered users and 4 guests

cron