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

fix rgba8 image jpeg encode bug #2169

Merged
merged 3 commits into from
Mar 23, 2024
Merged

fix rgba8 image jpeg encode bug #2169

merged 3 commits into from
Mar 23, 2024

Conversation

yuanyan3060
Copy link
Contributor

No description provided.

@fintelia
Copy link
Contributor

Could you also change JpegEncoder::encode to reject La8 and Rgba8 color types? Since JPEG cannot represent an alpha channel, we shouldn't be silently allowing it.

Sadly, I think we have to allow RGBA in JpegEncoder::encode_image because there are probably existing users calling it with DynamicImage and that type implements GenericImageView<Pixel=Rgba<u8>>.

@fintelia fintelia linked an issue Mar 23, 2024 that may be closed by this pull request
@fintelia fintelia merged commit c193acb into image-rs:main Mar 23, 2024
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Saving RgbaImage as JPEG is incorrect
2 participants