- Joined
- Jun 18, 2002
- Messages
- 28,547
Gosh mondblut, if only I was as smart as you and had thought of that. Honestly I just poked around the admin panel and scratched my head a few times looking for a "change the avatar size" option while farting and scratching my ass. It's not like I googled "how to change avatar size in XenForo" or anything either.Hm... I have zero experience with forum software, but could you perhaps look for references to "96" in xenforo code and replace it with a smaller value? It is ought to have something like "if X is less than 96, scale to 96" somewhere, does it not? Is it binary or in human-readable form like php or py?
If you really want the nerdy answer...
Most of the avatar details seem (and I say seem, because with XenForo it's hard to tell sometimes) to be handled in forums\library\XenForo\Model\Avatar.php
That sets the hard-coded (bad XenForo, bad XenForo!) default sizes for avatars as:
Code:
protected static $_sizes = array(
'l' => 192,
'm' => 96,
's' => 48
);
These are the sizes of avatars used in your profile (l), next to your forum post (m) and the little icons you see (s). XenForo automatically scales avatars to these sizes whenever you choose one. All the gallery does is let you pick an avatar and then "uploads" it like a custom avatar would, generating the required images as it goes (which are saved as image files with file names that correspond to your user id).
Now yes, I can dick around with those sizes. But what size do I go for? 80? 70? Any avatars smaller will still get fucked - but more importantly - any avatars larger than that will also likely get fucked. But... I don't want XenForo to scale avatars at all. If the avatar is 10px by 10px I want it to be 10x10, if it's 90x90 I want it to be 90x90. Whatever size I pick, something gets screwed. It will either be too big, or too small.
Plus if I change these values, I need to remember to re-do it every-time I upgrade the forums (which is already becoming a long list of mods that need to be re-installed along with other tweaks).
Now remove the scaling means re-coding the entire routine - which is not happening. It would also fuck up the small images which we need. That's the major issue. Minor issue is that I'd then get to dick around in the style to get the avatars to "look right" for their new size as XenForo has some CSS that determines what gets cut-off where and such.
But finally... As you'd know if you followed the link above: You will need to re-upload your avatar so the new "m" size can be saved. Also, the three default avatars should have their medium size changed too.
That is, we would have to re-upload every single avatar in the entire gallery to the new size... which Crooked Bee is already doing using 96x96 as the guide.
So, we stick with 96px by 96px, save us a coding hassle every-time we upgrade (DU why's my avatar fucked did you just upgrade fix it fix it fix it. Fix it now!!) and be done with it.
Yep. That's because I've already messed with the template and forced XenForo to use the L sized image when displaying the avatar. That's why bigger avatars no longer get cut-off. You'd note that if anyone did upload an avatar that large though, it would over-flow into the message area of that user's posts...edit: hm, page code states "192" for avatar width and height rather than 96, curious:
Code:<a href="index.php?members/darkunderlord.5/" class="avatar Av5l" data-avatarhtml="true"><img src="data/avatars/l/0/5.jpg?1381609115" width="192" height="192" alt="DarkUnderlord" /></a>
For the record, this is the code as it appears in the template in XenForo's back-end:
Code:
<xen:avatar user="$user" size="l" img="true" />