|
| Description: |
Notification emails embed the avatar of each user involved in the events and the wiki logo, as inline attachments.
h2. User avatars
The avatar is read with Java ImageIO to be cropped and resized to a small JPEG ({{UserAvatarAttachmentExtractor}}). When there is no ImageIO reader for the format of the avatar (SVG, WebP, AVIF, JPEG XL, ...) {{ImageIO.read}} returns {{null}} and a {{NullPointerException}} is thrown. As a consequence: * a warning with a full stack trace ("Failed to add the avatar of \[...\] in the email") is logged for each such user, in each notification email; * the avatar of the user is missing from the email, instead of being replaced by the default avatar, which is what is already done for users who don't have an avatar.
Steps to reproduce: set as avatar of a user a WebP image (e.g. a WebP image saved from a website with a {{.jpg}} or {{.png}} name, or an {{.svg}} / {{.webp}} attachment selected from the object editor), then make this user modify a page watched by another user who receives email notifications.
Expected: the default avatar is used (with at most a short log message, without stack trace).
h2. Wiki logo
The logo of the color theme or of the skin is embedded as is, except when its name ends with {{.svg}} ({{LogoAttachmentExtractor}}). This check is case-sensitive (a {{Logo.SVG}} file is embedded) and lets through any other format, while most including formats that are poorly supported by mail clients only reliably display PNG (TIFF , AVIF/HEIF, JPEG and GIF images XL), see e . g. https://www.caniemail.com.
Expected: only embed a color theme or skin logo whose media type is {{image/png}} in a list of supported media types , {{image/jpeg}} or {{image/gif}}, and otherwise fall back to the next logo (skin logo, then the default {{logo.png}}), like it is already done for SVG logos (see XWIKI-18299). Note that BMP, ICO or TIFF logos would then not be embedded anymore, which The list is fine since most mail clients cannot display them anyway configurable in {{xwiki .
This becomes more likely properties}} ({{notifications.emails.logo.supportedMediaTypes}}) and defaults to happen once WebP {{image/png}} , {{image/jpeg}}, {{image/gif}}, {{image/bmp}}, {{image/x-icon}}, {{image/vnd.microsoft.icon}} and {{image/webp}}, so that only SVG, TIFF, AVIF /HEIF and JPEG XL images can be selected as avatars and logos (XWIKI-25320) stop being embedded by default . Administrators whose recipients mostly use classic Outlook for Windows can remove {{image/webp}}. |
| Attachment: |
XWIKI-25318-after-mail-embedded-avatar-and-logo.png |
|