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

An invalid ICO image is generated when it includes multiple BMP images #2192

Open
sorairolake opened this issue Apr 5, 2024 Discussed in #2185 · 0 comments
Open

An invalid ICO image is generated when it includes multiple BMP images #2192

sorairolake opened this issue Apr 5, 2024 Discussed in #2185 · 0 comments

Comments

@sorairolake
Copy link
Contributor

Discussed in #2185

Originally posted by sorairolake March 26, 2024
I wrote a code to create a ICO file containing multiple BMP or PNG images:

https://github.com/sorairolake/favico/blob/1c5cb360350097900988bb407c81368d55512648/src/generate.rs#L40-L59

The generated ICO file containing multiple PNG images seems correct, but it containing multiple BMP images seems corrupted:

$ identify png/favicon.ico
png/favicon.ico[0] PNG 16x16 16x16+0+0 8-bit sRGB 269B 0.010u 0:00.000
png/favicon.ico[1] PNG 32x32 32x32+0+0 8-bit sRGB 323B 0.010u 0:00.000
png/favicon.ico[2] PNG 48x48 48x48+0+0 8-bit sRGB 1027B 0.000u 0:00.000

$ identify bmp/favicon.ico
identify: improper image header `bmp/favicon.ico' @ error/icon.c/ReadICONImage/400.

How can I create a ICO file containing multiple BMP images which is not corrupted?

@sorairolake sorairolake changed the title An invalid ICO image is generated when it including multiple BMP images An invalid ICO image is generated when it includes multiple BMP images Apr 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants