I am using Magick.NET 22.214.171.1241
I am working with ICO files. It appears I can only read an ICO given a file path (string). Attempting to read from a stream or byte array throws the following exception:
MagickMissingDelegateErrorException: "Magick: no decode delegate for this image format `' @ error/blob.c/BlobToImage/361"
This sample code reproduces the problem:
Dim wc As New Net.WebClient
Dim iconPath As String = "http://www.cnn.com/favicon.ico"
'Read from stream -> doesn't work
Dim col1 As New MagickImageCollection(wc.OpenRead(iconPath))
'Read from byte array -> doesn't work
Dim col2 As New MagickImageCollection(wc.DownloadData(iconPath))
'Read from file -> works
Dim col3 As New MagickImageCollection(iconPath)
I don't know a lot about ImageMagick, but I'm assuming that it's getting tripped up because it doesn't know what type of file it's getting, and it's unable to identify the file by content. The only time it works is when it gets a file path, so it can see the
file extension. I don't see any way to pass type information to the Stream or Byte() overloads...MagickReadSettings doesn't take a file type. Am I missing something, or is there a way to get this to work?
Thanks in advance,