bitbank2 / PNGenc

An embedded-friendly PNG encoder
Apache License 2.0
39 stars 8 forks source link

Uncorrect output testing on linux #10

Closed Pafrak closed 1 year ago

Pafrak commented 1 year ago

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,

Pafrak commented 1 year ago

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.

bitbank2 commented 1 year ago

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