Closed thecaptncode closed 4 years ago
According to the error message the file does not start with a valid image header.
The code that checks these can be found here: https://github.com/imazen/imageflow/blob/696fea2036d3439dd6969570caef9b87cbc76db9/imageflow_core/src/codecs/mod.rs#L77-L88
Do you have an example image in webp format that causes this error? Are you sure that nothing else is seeking the stream before it is read?
There is a link at the bottom of the issue to an image that produces exactly that error. Examining the image in Firefox reveals that it is a WEBP image.
I am certain the stream is at the beginning. I can pick through the stream to see if it looks as expected. Perhaps there is an issue there. I have examined the WEBP file before in a hex editor and I saw the RIFF and WEBP in it where expected but I did not check the stream to see if that was it.
The error message gives you the first bytes of the stream, in this case [49, 49, BC, 1, 20, 0, 0, 0, 24, C3, DD, 6F]
. That does not look like a RIFF/WEBP header. Can you share all of the code you are using to load the stream? I would suggest debugging and inspecting the stream bytes.
That was a very good catch. I debugged the stream and found an encoding issue that was only manifesting when I was testing WEBP. I am sorry to bother you. Sometimes the ones that stump you are due to making an assumption. Thank you for pointing that out.
I have installed ImageFlow.Net and the correct runtimes into my asp.net webforms project. ImageFlow reads JPG and other image formats just fine using the following code:
However, when I use GetImageInfo on a WEBP image I receive the following exception:
Is there something I didn't install or need to reference? An example image that throws the above exceptions with the above code is here: https://media.wuerth.com/source/eshop/stmedia/wuerth/images/std.lang.all/resolutions/category/576px/105488.jpg