Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Webp with alpha channel creates jpg thumbnails with no alpha. #16424

Closed
shangjiaxuan opened this issue Oct 3, 2023 · 1 comment
Closed

Webp with alpha channel creates jpg thumbnails with no alpha. #16424

shangjiaxuan opened this issue Oct 3, 2023 · 1 comment

Comments

@shangjiaxuan
Copy link

Description

As stated in title. Webp pictures with transparency uploaded are generated jpg thumbnails without transparency. This shows glitchy thumbnails when the client renders it. The location issuing this thumbnail generation have not been identified (dynamic thumbnails have not been configured, so it should be synapse default).

Element android client shows the shown glitchy image in thumbnail, while desktop shows the full image, other clients have different result (fluffychat on android shows the full image). If the thumbnails are in jpg because Element requested it in jpg, then this is a problem with the client, and will move this issue to Element.

Original image (text may be inappropriate for work)
Image info given by ffmpeg:

$ ffmpeg -i '_ _glowing star__20230924231343.webp'
<!--ffmpeg compilation info redacted -->
Input #0, webp_pipe, from '_ _glowing star__20230924231343.webp':
  Duration: N/A, bitrate: N/A
  Stream #0:0: Video: webp, yuva420p(tv, bt470bg/unknown/unknown), 512x443, 25 fps, 25 tbr, 25 tbn, 25 tbc

Image info on postgres database:

synapse=# select * from local_media_repository where media_id = 'vBHhuRaunxOHxqmmnehZTjpT';
         media_id         | media_type | media_length |  created_ts   |             upload_name              |          user_id          | quarantined_by | url_cache | last_access_ts | safe_from_quarantine
--------------------------+------------+--------------+---------------+--------------------------------------+---------------------------+----------------+-----------+----------------+----------------------
 vBHhuRaunxOHxqmmnehZTjpT | image/webp |        36654 | 1696332462446 | _ _glowing star__20230924231343.webp | <!-- redacted -->|                |           |  1696336266112 | f
(1 row)

Thumbnail info on postgres database:

synapse=# select * from local_media_repository_thumbnails where media_id = 'vBHhuRaunxOHxqmmnehZTjpT';
         media_id         | thumbnail_width | thumbnail_height | thumbnail_type | thumbnail_method | thumbnail_length
--------------------------+-----------------+------------------+----------------+------------------+------------------
 vBHhuRaunxOHxqmmnehZTjpT |             277 |              240 | image/jpeg     | scale            |            20974
 vBHhuRaunxOHxqmmnehZTjpT |              32 |               32 | image/jpeg     | crop             |             1267
 vBHhuRaunxOHxqmmnehZTjpT |             512 |              443 | image/jpeg     | scale            |            32720
 vBHhuRaunxOHxqmmnehZTjpT |              96 |               96 | image/jpeg     | crop             |             5349
(4 rows)

Glitchy thumbnail shown on Element Android (same as original image, text may be inappropriate for work)

Steps to reproduce

  • Upload a webp image with transparency to chatroom
  • See the thumbnail on Element chat context.

Homeserver

self-hosted: matrix.nepfan.club (manual account registration only)

Synapse Version

{"server_version":"1.64.0","python_version":"3.9.2"}

Installation Method

Debian packages from packages.matrix.org

Database

PostgreSQL

Workers

Single process

Platform

Debian GNU/Linux 11 (bullseye), running on virtual machine.

Configuration

No response

Relevant log output

Not crashing, only usage level inconvenience.

Anything else that would be useful to know?

No response

@clokep
Copy link
Member

clokep commented Oct 3, 2023

Duplicate of #11840.

@clokep clokep closed this as completed Oct 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants