Controlling the Size of Avatars

Controlling the Size of Avatars

Controlling the Size of Gravatar Avatars

Gravatar is a service that enables portable avatars that can be used across different sites. This makes a more social avatar since it is consistent when a user interacts with different sites on the internet. You can control the size of the Gravatar from the file of your skin

<portal:Gravatar  runat="server" Size="80" />

80 is the default size, and the valid range for this setting is from 1 to 512.

You can also control the default image displayed if a user does not have a Gravatar by adding this to your file of your skin:

<portal:Gravatar runat="server"

You can put a full url to a custom image on your own site or you can set one of the keyword default values indicated in the Gravatar documentation here.

Controlling the Size of User Uploaded Avatars

By default mojoPortal content management system uses Gravatar avatars, but you can change it to use user uploaded files from Administration > Site Settings. There you will see a dropdown list for Avatar System. If you configure your site to use user uploaded Avatars, you can control the size of the avatars by overriding these settings from web.config in your user.config file.

<add key="ForceSquareAvatars" value="true"/>
    <add key="AvatarMaxWidth" value="90"/>
    <add key="AvatarMaxHeight" value="90"/>
    <!-- Original images uploaded for avatars. Images larger than the maxoriginal settings will be
         resized even before cropping to avoid mega large images being stored -->
    <add key="AvatarMaxOriginalWidth" value="800"/>
    <add key="AvatarMaxOriginalHeight" value="800"/>

When users upload a larger image they are able to crop it to the specified avatar size.

Note that these settings should be set before users upload avatars, changing these settings will not alter avatar images previously uploaded by a user.

Created 2011-09-16 by Joe Audette
Updated 2011-12-28 by Joe Audette