synapse icon indicating copy to clipboard operation
synapse copied to clipboard

Synapse's media repository does not preserve colourspace when thumbnailing

Open ara4n opened this issue 1 year ago • 1 comments

Description

Wide gamut images get their colourspace ignored or removed when thumbnailed by Synapse, making the thumbnail look distinctly drab.

Steps to reproduce

  • Upload an image with wide gamut colour to Synapse (e.g. a JPEG in P3 colour space): https://matrix-client.matrix.org/_matrix/media/v3/download/matrix.org/qcexnobqNXHNFShayQgolvsy
  • Observe that thumbnail calculated by the sending client is P3 and nice and vivid (when viewed on a wide gamut display): https://matrix-client.matrix.org/_matrix/media/v3/download/matrix.org/IqxsdtpAuPvBYfcbsyqcNTxF
  • Observe that the thumbnail calculated by Synapse is drab and no longer wide gamut: https://matrix-client.matrix.org/_matrix/media/v3/thumbnail/matrix.org/qcexnobqNXHNFShayQgolvsy?width=1600&height=1200&method=scale. From a guess, it's just stripping off the colourspace to a default sRGB when thumbnailing it.

Homeserver

matrix.org

Synapse Version

1.101.0 (b=matrix-org-hotfixes,beff0a756e)

Installation Method

Other (please mention below)

Database

postgres

Workers

Multiple workers

Platform

Debian 10.13

Configuration

No response

Relevant log output

None

Anything else that would be useful to know?

No response

ara4n avatar Mar 01 '24 13:03 ara4n

related: https://github.com/matrix-org/synapse/issues/6021 aka https://github.com/element-hq/synapse/issues/6021

ara4n avatar Mar 01 '24 13:03 ara4n