Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Gavatar - Multiple Sizes

mcu_hqmcu_hq ✭✭✭
edited April 2012 in Vanilla 2.0 - 2.8

I'm wondering why the UserPhotoDefaultUrl function does not allow multiple sizes of the thumbnail size that it uses. I am aware that it uses Garden.Thumbnail.Width to set the width, but what if I want to use the picture in two different scenarios which require two different sizes? For example, I want to use the gravatar image in the profile page which requires a width of 160px versus just the regular 50px thumbnail for discussions.

This is my current hack:
$DefaultWidth = C('Garden.Thumbnail.Width',50); SaveToConfig('Garden.Thumbnail.Width',250); echo UserPhoto($Builder, array('LinkClass' => 'ProfileMainImage', 'ImageClass' => 'ProfileMainImage')); SaveToConfig('Garden.Thumbnail.Width',$DefaultWidth);

I would like to see this changed in the next release if possible.

Tagged:

Answers

  • But you could control this with .css by appending the body id from profile to your profile image class. Couldnt you?

    There was an error rendering this rich post.

  • peregrineperegrine MVP
    edited April 2012
    Couldn't you also get rid of the Garden.Thumbnail.Width out of config totally
    and just assign width and height here.
    
    scenario 1
    echo UserPhoto($Builder, array('LinkClass' => 'ProfileMainImage', 'ImageClass' => 'ProfileScenarioOne'));
    
    
    .ProfileScenarioOne 
    
    {
    width:100px;
    height:100px;
    }
    
    scenario 2
    and change the width and height on other pages
    echo UserPhoto($Builder, array('LinkClass' => 'ProfileMainImage', 'ImageClass' => 'ProfileScenarioTwo'));
    
    .ProfileScenario2 
    {
    width:200px;
    height:200px;
    }
    

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • mcu_hqmcu_hq ✭✭✭

    422 said:
    But you could control this with .css by appending the body id from profile to your profile image class. Couldnt you?

    I could, but I would be stretching the orginal image to fit whatever resolution is specified in CSS.

    The same with @peregrine.....I need to specify the source image as larger. Anything else will just stretch it to fit the resolution. I am going to stick my workaround for right now.

  • Similar to youtube thumbs, do gravatars come in varying resolutions?

    There was an error rendering this rich post.

  • mcu_hqmcu_hq ✭✭✭

    422 said:
    Similar to youtube thumbs, do gravatars come in varying resolutions?

    yes they do...the size of the image is put into part of the URL

  • Couldnt you do a preg replace.

    There was an error rendering this rich post.

Sign In or Register to comment.