// AVATARS
@_avatarBaseSize: 96px;
@avatar-xxs: (@_avatarBaseSize) / 4;
@avatar-xs: (@_avatarBaseSize) / 3;
@avatar-s: (@_avatarBaseSize) / 2;
@avatar-m: (@_avatarBaseSize);
@avatar-l: (@_avatarBaseSize) * 2;
@avatar-o: (@_avatarBaseSize) * 4;
<xf:avatar />
and increase the size to 1 step. Then you downscale them with CSS.<xf:avatar user="$user" size="m" defaultname="{$fallbackName}" itemprop="image" />
<xf:avatar user="$user" size="l" defaultname="{$fallbackName}" itemprop="image" />
data/avatars
folder. Upon uploading, XenForo will create 5 versions of each avatar, scaled to the respective size. This will improve page load time especially for large avatars and mobile devices, but when you then try to enlarge a 48x48 (S Size) avatar, you'll obviously get blurry results.Have a look into yourdata/avatars
folder. Upon uploading, XenForo will create 5 versions of each avatar, scaled to the respective size. This will improve page load time especially for large avatars and mobile devices, but when you then try to enlarge a 48x48 (S Size) avatar, you'll obviously get blurry results.
data/avatars/m/
directory. These are 96x96 which is the same as the display size. Meaning they are not being scaled up with CSS. The quality is just poor, so back to my previous question.The actual size limit is 384px.It really should be an integral part of the forum software and included settings, but it's not. 96px is not very large and needs to be increased. I hope XF team reads this thread and make an effort to give us the ability to adjust the size in the near future.
What exactly would the CSS downscale look like if you don't mind me asking?Then use CSS and downscale that avatar to the desired dimensions. Repeat this step for any avatar occurrences.
You explicitly set width and height of an element. If your image is displayed as a background image it's best to also setWhat exactly would the CSS downscale look like if you don't mind me asking?
background-size: cover;
.message-cell .avatar--l
{
width: 96px;
height: auto;
}
body .avatar.size--ANY
{
width: ANY;
height: ANY;
}
body .avatar img:not(.cropImage)
{
object-fit: contain; /* or object-fit: cover; if you want avatars to cover the box completely */
}
auto
there. Also, don't forget to change the actual size
property in xf:avatar
.This would work only with modern browsers (no IE):
CSS:body .avatar.size--ANY { width: ANY; height: ANY; } body .avatar img:not(.cropImage) { object-fit: contain; /* or object-fit: cover; if you want avatars to cover the box completely */ }
Replace ANY with your selectors and dimensions. Don't useauto
there. Also, don't forget to change the actualsize
property inxf:avatar
.
We use essential cookies to make this site work, and optional cookies to enhance your experience.