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

alpha mask check in ico files #2203

Closed
cyberpunkbln opened this issue Apr 11, 2024 · 2 comments
Closed

alpha mask check in ico files #2203

cyberpunkbln opened this issue Apr 11, 2024 · 2 comments

Comments

@cyberpunkbln
Copy link

Hello,

I have the same problem like the user in #1590. Some ico extracted from an exe has an rgb8 format without alpha channel. I want only extract the png from this ico-file.

I load the ico with the method image::open ("bad_ico.ico") but i have only the option for imageresult ok() or err().

Is it possible to extract that rgb8-png with the current version? some trick? When not can you implement this from the #1590?

thx

@fintelia
Copy link
Contributor

If you just need to decode that one image, you can always fork the code and use it get an extracted version from the file.

However, there's a higher bar for changing the code for everyone. We generally want to reject image files that other decoders consider to be corrupt. So to eliminate the check, we'd either need to find evidence that ICOs with embedded RGB PNGs are actually valid according to some relevant spec or that other mainstream decoders already accept them.

@cyberpunkbln
Copy link
Author

@fintelia I checked my whole process and i have seen that when i extract the ico from exe i must check if the png is present and then use the rgb8-png to extract and give it to my piece of code as image to convert. The image-lib recognize the type automaticly. For ico-files directly i parse the icondir in the future and think i test the image-format.

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