Project

General

Profile

Actions

Feature #44684

closed

Show the built-in initials avatar for users without a Gravatar image

Feature #44684: Show the built-in initials avatar for users without a Gravatar image

Added by Go MAEDA 21 days ago. Updated 10 days ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
UI
Target version:
Resolution:
Fixed

Description

When Gravatar is enabled, users who have not registered an image on Gravatar are shown the image chosen in "Default Gravatar image". If no default image is selected, Gravatar returns its own logo, so all of these users get the same image and are hard to tell apart. This patch shows Redmine's built-in initials avatar for these users instead. Redmine already uses this avatar when Gravatar is disabled, so these users look the same whether Gravatar is enabled or not.

Before After

Gravatar can generate initials images itself (the "Initials" option), but this has two problems. First, it raises a privacy concern for users with Chinese, Japanese or Korean names. To generate the initials, the first character of each part of the name is sent to Gravatar. These names are usually three or four characters long, so the two initials are half or more of the name. For example, my name is "前田 剛" (Go Maeda), which has three characters, and "前剛", two of those three characters, is sent to Gravatar. For two-character names, which are not unusual in Chinese, the initials are the whole name. Much of the user's name is therefore sent to an external service. Second, the result looks different from the initials avatar used elsewhere in Redmine, as shown in the screenshot below (compare it with the "After" screenshot above). The built-in initials avatar is drawn by Redmine itself, so no name is sent to an external service.

This patch implements the fallback as follows. When "Default Gravatar image" is blank, the Gravatar URL is requested with d=404, so Gravatar returns HTTP 404 for email addresses that have no registered image. A Stimulus controller (initials-avatar-fallback) catches the image's error event and replaces the image with Redmine's built-in initials avatar. It also handles images that failed to load before the controller connected. If a default image such as Identicon or Retro is selected, nothing changes.

In Administration > Settings > Display, the blank option is now labelled "Initials (built-in)" and the existing "initials" option is now labelled "Initials (Gravatar)", so the two are easy to tell apart. The default value of gravatar_default in config/settings.yml is changed from identicon to blank, so new installations use the built-in initials avatar. As a result, users without a Gravatar image are shown the same initials avatar whether "Use Gravatar user icons" is enabled or not. Enabling Gravatar only changes the avatars of users who have registered an image there. Existing installations are not affected, because the selected default image is saved when Gravatar is enabled on the settings page.

Before After

The text text_avatar_from_server_html on the avatar page is updated so that it is also correct when a default avatar is shown. The new English text has been copied to all locales, so translators will need to update it.


Files

Updated by Go MAEDA 18 days ago Actions #1

  • Target version changed from Candidate for next major release to 7.1.0

Setting the target version to 7.1.0.

Updated by Go MAEDA 10 days ago Actions #2

  • Status changed from New to Closed
  • Assignee set to Go MAEDA
  • Resolution set to Fixed

Committed the patches in r25440, r25441 and r25442.

When "Initials (Redmine)" (previously "none") is selected for "Default Gravatar image", users who have no Gravatar image are now shown with the initials avatar generated by Redmine. Before this change, Gravatar's default logo was shown for all of these users, so they could not be told apart. Unlike the "Initials" option of Gravatar, no part of the user's name is sent to Gravatar. This is now the default for new installations. Existing installations keep their current setting.

Note for contributors to the Italian and Swedish translations: in text_avatar_from_server_html, the existing translation is kept and the new English sentence “If no image is registered there, a default avatar is shown.” is added after it. Only that sentence needs to be translated.

Actions

Also available in: PDF Atom