XF 2.1 170x250 avatar sizes

kray

Member
So how can i enlarge my avatar size to 170x250 without the picture covering stuff it shouldn't.

An example:

VW5TQpn.png
 
take a look here
When you got it to work the avatar didn’t look stretched or compressed when you made it taller vertically?
 
I mean, now it's just overlapping, and it's forcing every single member to use the same resolution. I just would like it to be 170x350 at max and if you have a picture that's lower than that then it should stay that way and not force it up to the maximum resolution.

Mine:

fk89ZNE.png


His:

kvZkEWW.png
 
That’s the problem I’m coming to. In XF 1 I had a code that set a width for everyone and let the height be whatever as long as it was under the max height. No stretching of the avatar and not everyone had to have the same height.
 
also don't forget to change "l" to "o" in extra.less code

Code:
.avatar.avatar--o {
    max-width: 150px;
    width: 150px;
    height: 200px;
    max-height: 200px;
}


size doesnt change

Code:
<xf:avatar user="$user" size="o" defaultname="{$fallbackName}" itemprop="image" />
Code:
.avatar.avatar--o {
    max-width: 180px;
    width: 180px;
    height: 300px;
    max-height: 300px; 
}
 
Last edited:
I use it in this forum and work fine
 
also don't forget to change "l" to "o" in extra.less code

Code:
.avatar.avatar--o {
    max-width: 150px;
    width: 150px;
    height: 200px;
    max-height: 200px;
}
I just used this code and replaced the dimensions with the ones I wanted to use and replaced height with auto and it works like gangbusters!

Thank you so much @XenArabia! I really appreciate your help!
Code:
.avatar.avatar--o {
    max-width: 150px;
    width: 150px;
    height: auto;
    max-height: 200px;
}
@kray if you use auto on the height and fill in the max-height to whatever you want there's no stretching.

tumblr_pozvklcdiw1r43lwqo1_400.png


It works!
 
Top Bottom