❔ supporting .ico files on non-windows platforms
I searched the web for how to convert a .ico file into a bmp or png or basically anything else, but every example I found used System.Drawing libs that are only available on windows. A lot of web pages still use .ico files as favicons as an anachronistic backwards compatibility thing for Internet Explorer.
Does anyone know of a way to take a .ico file in memory and convert it to a better supported format?
5 Replies
ImageSharp maybe?
If not, just find some ImageMagick wrapper, or even invoke it directly
looking at magick.net, I will post here if it works as a solution
Its a pity I have to use a temp file, imagemagick can read a byte array but for some reason it fails in this case. Still this is a nicer and cleaner solution than any I found using the System.Drawing libs. I might use this lib (https://github.com/dlemstra/Magick.NET) for all my image needs in future.
GitHub
GitHub - dlemstra/Magick.NET: The .NET library for ImageMagick
The .NET library for ImageMagick. Contribute to dlemstra/Magick.NET development by creating an account on GitHub.
Thanks for the suggestion.
ah I sorted it, ico has no file type identifier at the beginning of the file so without the file suffix imagemagick cant identify what format it is in. The correct code is:
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.