bitbank2 / PNGenc

An embedded-friendly PNG encoder

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Uncorrect output testing on linux

Pafrak opened this issue · comments

Hello @bitbank2 ,
I've tested your code with a sample QVGA bmp that I attach here and I have a corrupted output. I'm chasing the bug in case you have any suggestion that's welcome!

test_png.zip

Thanks,

I just found out that if I change in png.inl line 333:

from Z_NO_FLUSH to Z_FULL_FLUSH
err = deflate(&pImage->c_stream, Z_FULL_FLUSH);

it convert the image, but still I have color issues:

out.zip

that might an rgb ordering issue. I need to check zlib source, since I don't understand at all what's happening under the hood.

Thanks for finding the 2 issues. I combined them into a single commit that I pushed.