When using a Png file I get this error:
ImageProcessorCore.ImageFormatException: Interlacing is not supported
some png works but some doesn't.
The code is here:
https://github.com/JimBobSquarePants/ImageProcessor/blob/abbf63f863635d4df1a04d322eccd425db7e82db/src/ImageProcessorCore/Formats/Png/PngDecoderCore.cs#L385
What does this mean? is this a limitation of the library or am I doing something wrong or a bug?
Hi @Bartmax
It means exactly that. Png files can be interlaced but it is strongly recommended not to do that as it hurts compression, increasing filesize.
See
Interlaced png files are generally uncommon so I haven't gone out of my way to support them cos it's complex. I could maybe add support in the future though as there is good reference material to base my code on so if you could share a failing image that would be really useful.
Thanks for the fast reply.
Here is a sample file that is failing. I have 3 out of 10 that seems to be interlaced :(

No worries. I'll branch off and try to tinker with it. Fingers crossed it's not too difficult.
This is tricky stuff...
I've been looking at the spec and also the Golang implementation.
https://www.w3.org/TR/PNG/
https://golang.org/src/image/png/reader.go
Reading up it looks like I need to decode each scanline 8 times which will require some significant refactoring here.
I could really do with someone who has done this before stepping up and adding the code.
@JimBobSquarePants
Just a little question here. There is an option to use the .Net native image load implementation and convert the resulting Bitmap to the format you need ?
ie. try to use custom decode for the pngs but, if interlaced, so use Bitmap constructor: https://msdn.microsoft.com/en-us/library/z7ha67kw(v=vs.110).aspx
Thanks
The library should build on .NET Core where we don't have the Image class of System.Drawing. Adding it to the encoder should be the way to go.
@dlemstra Thanks for clarification, I understand now.
This issue was moved to JimBobSquarePants/ImageSharp#9
Most helpful comment
No worries. I'll branch off and try to tinker with it. Fingers crossed it's not too difficult.