Profile Image Looks Blurry After Resizing

This happens because the avatar size requested in that template is “huge”

“huge” here means 120px for normal DPI screens and 240px for high DPI screens.

If you want to request 500px avatars, you need to override the template here

you can do it like so (in the Header section of your theme)

<script type="text/x-handlebars" data-template-name="components/user-profile-avatar">
<div class='user-profile-avatar'>
  {{bound-avatar user "500"}}
  {{#if user.primary_group_name}}
    {{avatar-flair
      flairURL=user.primary_group_flair_url
      flairBgColor=user.primary_group_flair_bg_color
      flairColor=user.primary_group_flair_color
      groupName=user.primary_group_name}}
  {{/if}}
  {{plugin-outlet name="user-profile-avatar-flair" args=(hash model=user) tagName='div'}}
</div>
</script>

You can read more about overriding Discourse templates here

Please note that if you override a template, and it changes in Discourse core, you need to update your override.

6 curtidas