-
Notifications
You must be signed in to change notification settings - Fork 26.1k
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
Fix wrong conversion to JPEG instead of PNG when WEBP/AVIF is not supported (fixes images with alpha channels) #36611
Conversation
This way even if the unsupported contentType (webp/avif) has an alpha channel, it won't turn black.
I think this might not be the right approach as PNGs are generally bigger than JPEGs and would penalize use cases where transparency is not an issue. We should somehow detect if an image has transparency and only convert it to PNG if it does instead. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you compare the size before and after?
This will likely increase the size so its not desirable.
Instead, the image should be analyzed for transparency/alpha and only use PNG in that case.
Lastly, we need tests to prove this is working as expected.
@styfle Is there a standard way somewhere else in |
I don't think we have any existing logic for this behavior |
Fixes the GitHub CODEOWNERS pattern matching which previously missed adding me to #36611
df8579c
to
47e5ebe
Compare
e078ebe
to
6b863fe
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Going to close this as stale, feel free to open fresh PR considering above feedback if interested!
Change the fallback contentType from JPEG to PNG.
This way even if the unsupported contentType (webp/avif) has an alpha channel, it won't turn black.
Fixes #35674
It's in direct relation and extension to a previously resolved issue #20794 fixed by PR #35190