Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a way to compress PNG images when uploading #9277

Closed
saschanaz opened this issue Dec 5, 2022 · 2 comments · Fixed by #9334
Closed

Add a way to compress PNG images when uploading #9277

saschanaz opened this issue Dec 5, 2022 · 2 comments · Fixed by #9334
Labels
✨Feature This adds/improves/enhances a feature

Comments

@saschanaz
Copy link
Member

Summary

I just set my profile header image from Snipping Tool on Windows, which generates PNG image by default. That caused a big 1 MB header. I don't want to let any visitors to download that much just for a silly header image.

It seems PNG is never compressed per the following code, if I'm reading right:

const compressTypeMap = {
'image/jpeg': { quality: 0.85, mimeType: 'image/jpeg' },
'image/webp': { quality: 0.85, mimeType: 'image/jpeg' },
'image/svg+xml': { quality: 1, mimeType: 'image/png' },
} as const;

Maybe PNG should also be compressed by default since there is an explicit flag to opt-out?

@saschanaz saschanaz added the ✨Feature This adds/improves/enhances a feature label Dec 5, 2022
@tamaina
Copy link
Contributor

tamaina commented Dec 5, 2022

Client compression of png is disabled because apng cannot be processed (correctly, the processing implementation was put off).

#8216

@tamaina
Copy link
Contributor

tamaina commented Dec 5, 2022

MEMO

How to identify whether webp image is static or animated?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨Feature This adds/improves/enhances a feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants