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

Detect alpha on jpeg #2317

Closed
mothsART opened this issue Aug 29, 2024 · 2 comments
Closed

Detect alpha on jpeg #2317

mothsART opened this issue Aug 29, 2024 · 2 comments

Comments

@mothsART
Copy link

I read #2211 and I think this issue is slightly diff.

Image-rs doesn't detect when an jpeg image is rgb8 or rgba8.

With the software The Gimp, I have opened a jpeg file without alpha channel :

rusted_chain__with_alpha

Secondly, I have created a other jpeg file with an alpha channel :
rusted_chain__without_alpha

Expected

On the 2 pictures, img.color() give me Rgba8 and img.color().has_alpha() is true.

What behaviour should have happened

I think, first picture will give me Rgb8 and alpha on false.
The second picture will give me Rgba8 and alpha on true.

@fintelia
Copy link
Contributor

The JPEG file format cannot store alpha so I'd expect neither one to be Rgba8. Could you share the code you are using to load the images?

@mothsART
Copy link
Author

When I read the code from my projet, I realize than I used an intermediate buffer with rgba.
Sorry.

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

No branches or pull requests

2 participants