Transparent WEBP logo appears with black background in email template

Help for integrating the Laravel package
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
kdim95
Advanced
Posts: 207
Joined: 26 Aug 2022, 12:17

Transparent WEBP logo appears with black background in email template

Post by kdim95 » 04 Apr 2023, 14:03

Laravel framework version: 9.52.4
Aimeos Laravel version: ~2022.10
PHP Version: 8.2.4
Environment: Linux

Hello,

The website logo appears with a black background if using a WEBP logo with transparent background.

Steps to reproduce:
1) Set a WEBP logo with transparent logo for the website
2) Have Aimeos send an order status email

The logo appears with a black background in the received email, specifically on Gmail.

It appears that the logo is converted into jpeg in the email, can PNG be used instead and what files do I need to change?

User avatar
aimeos
Administrator
Posts: 7908
Joined: 01 Jan 1970, 00:00

Re: Transparent WEBP logo appears with black background in email template

Post by aimeos » 11 Apr 2023, 06:31

kdim95 wrote: 04 Apr 2023, 14:03 The website logo appears with a black background if using a WEBP logo with transparent background.

Steps to reproduce:
1) Set a WEBP logo with transparent logo for the website
2) Have Aimeos send an order status email

The logo appears with a black background in the received email, specifically on Gmail.
Is that only a problem in Gmail or other web mail clients or e-mail clients too?
kdim95 wrote: 04 Apr 2023, 14:03 It appears that the logo is converted into jpeg in the email, can PNG be used instead and what files do I need to change?
If it's converted to JPEG, this is done by Gmail, so we don't have any influence on that. You can change the default image format to PNG so uploaded files are converted to PNG instead of WEBP but the files will be significantly bigger and the page load time can be much longer for users. To do that, add a configuration for "controller/common/media/preview/allowedtypes" and re-order the list of mime-types so PNG comes first here:
https://github.com/aimeos/aimeos-core/b ... #L600-L606
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply