lvandeve / lodepng

PNG encoder and decoder in C and C++.
zlib License
2.06k stars 421 forks source link

Excessive calls to img_decoder (PNG) #76

Closed aenchevich closed 5 years ago

aenchevich commented 5 years ago

Hi Gabor

I am so happy that there is now PNG support! I do see something that looks like a bug and I am reporting it here, but overall - yay, great job!


So...

I followed the steps in https://littlevgl.com/blog/50/use-png-images-in-littlevgl and got the same visual results (the 4 dice are displayed over the blueish background, with transparency).

However I a get this output (I put printf's to the decoder functions to see when they are called. This is ran on the PC btw):

png_decoder_info called
png_decoder_info called
png_decoder_open called
png_decoder_close called
png_decoder_info called
png_decoder_open called
png_decoder_close called
png_decoder_info called
png_decoder_open called
png_decoder_close called
png_decoder_info called
png_decoder_open called
png_decoder_close called

As you can see, firstly png_decoder_info is called once and then the entire sequence (info-open-close) is repeated 4 times. This does not seem correct?

I am attaching my code, although it is pretty much the same as the tutorial...

decoder.cc.txt main.c.txt

aenchevich commented 5 years ago

Oooops.

This was supposed to be reported in another repository. Please excuse me and ignore this issue. I will remove it now :)