Change default avatar size.
-
Evening,
I want to change the default size of the avatars from 128px to 156px but it seems like this value is hardcoded and can't be changed.
Since Gravatar supports 1px up to 2048px images as stated here https://fr.gravatar.com/site/implement/images/
I don't think it's a big of a deal.Is there a way to do so actually or does this need to be implemented in core ?
-
I think all you need to do is to change the .profile-image class in CSS if you're using Lavender, and in lieu of being able to find it, do what I do and add a custom.less file to the mix and add !important to the end of it to get what you want.
Let me know if that fixes the avatar size for you.
-
The avatar sizes are hardcoded in the application itself. You can refer here to change the dimensions from the original 128x128 to whatever you'd like here:
For uploaded images:
https://github.com/NodeBB/NodeBB/blob/76ad2b8fb28a02a1a8c9cbbc1fac3c8c104fa876/src/controllers/accounts.js#L402For gravatar images:
https://github.com/NodeBB/NodeBB/blob/76b257f7b8ee8059ebbace84fb84bf5edde8d2ca/src/user.js#L278EDIT: Perhaps theres an easier way to do this when someone decided to make this configurable via the ACP, but until then, its manual.
-
@trevor Thanks but that's a fix and for the gravatar images just need to change the value in :
https://github.com/NodeBB/NodeBB/blob/76ad2b8fb28a02a1a8c9cbbc1fac3c8c104fa876/src/user.js#L282But this mean altering the core and I don't want to in order to follow the updates ect.
I think this could be a feature in ACP in General Settings > User > Avatars > Avatars sizes -
@esiao You just reiterated on what I just posted.
-
No, there's no other way except this method for now, but I hope this helps you!
By the way, @esiao it was edited 1 min before yours
-
closes #1974 路 NodeBB/NodeBB@5c84a3a
Node.js based forum software built for the modern web - closes #1974 路 NodeBB/NodeBB@5c84a3a
GitHub (github.com)