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

thumbnail byte-larger than original #2667

Open
penguin42 opened this issue Nov 12, 2017 · 4 comments
Open

thumbnail byte-larger than original #2667

penguin42 opened this issue Nov 12, 2017 · 4 comments
Labels
A-Media-Repository Uploading, downloading images and video, thumbnailing O-Uncommon Most users are unlikely to come across this or unexpected workflow S-Tolerable Minor significance, cosmetic issues, low or no impact to users. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues.

Comments

@penguin42
Copy link

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

  • Uploaded the image that's at mxc://matrix.org/nlkUlJCMIBWDWZLKjxZYknrn (123kB)
  • Download the thumbnail at mxc://matrix.org/VPkLkCQZUMycjuCrARzGbkKa (204kB)

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

  • Homeserver: matrix.org just now
@bkil
Copy link

bkil commented Aug 5, 2021

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

  • A thumbnail should not be saved if either the filesize did not get small or if the dimensions did not get much smaller but the filesize did not get significantly smaller either (i.e., storing both the original and a 90% thumbnail having 80% of size just wastes space)
  • 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.

@bkil
Copy link

bkil commented Aug 5, 2021

@bkil
Copy link

bkil commented Aug 5, 2021

See also: #4724

@erikjohnston erikjohnston added the T-Enhancement New features, changes in functionality, improvements in performance, or user-facing enhancements. label Aug 23, 2021
@clokep clokep added S-Tolerable Minor significance, cosmetic issues, low or no impact to users. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues. and removed T-Enhancement New features, changes in functionality, improvements in performance, or user-facing enhancements. labels Feb 1, 2022
@MadLittleMods MadLittleMods added the A-Media-Repository Uploading, downloading images and video, thumbnailing label Jun 10, 2022
@DMRobertson DMRobertson added the O-Uncommon Most users are unlikely to come across this or unexpected workflow label Aug 25, 2022
@DMRobertson
Copy link
Contributor

  • 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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Media-Repository Uploading, downloading images and video, thumbnailing O-Uncommon Most users are unlikely to come across this or unexpected workflow S-Tolerable Minor significance, cosmetic issues, low or no impact to users. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues.
Projects
None yet
Development

No branches or pull requests

6 participants