matrix-org / synapse

Synapse: Matrix homeserver written in Python/Twisted.
https://matrix-org.github.io/synapse
Apache License 2.0
11.79k stars 2.13k forks source link

thumbnail byte-larger than original #2667

Open penguin42 opened 6 years ago

penguin42 commented 6 years ago

Description

The thumbnail for an image I uploaded ended up bigger than the original in bytes at the same number of pixels

Steps to reproduce

Describe how what happens differs from what you expected.

It probably would have been better not to produce the thumbnail in the case where the result was larger. It's a good question why it's larger; both are the same res (513x405) - I think teh thumbnail added an alpha channel for no reason; but is that the reason it's so much larger?

Version information

bkil commented 3 years ago

This is still an issue. I would like to extend the scope of this issue:

bkil commented 3 years ago

See also: https://github.com/matrix-org/matrix-doc/issues/2060 https://github.com/matrix-org/matrix-doc/pull/2068

bkil commented 3 years ago

See also: https://github.com/matrix-org/synapse/issues/4724

DMRobertson commented 2 years ago
  • If I upload a .webp image, it's thumbnail is created as .png, that is vastly larger if it is photographic. In such a case, it should create a thumbnail either as .webp, or in both .jpeg and .png and only store the one which got smaller (if at all). Not sure if .avif is supported, but I guess it would have the same problem.

7586 made it so that thumbnails of WEBP images are JPEGs.