PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

png decoder

ysflight.com

this guy has a very simple png decoder class you can use for loading PNG. gives you access to an RGBA data. code is clean.

i've tried it only with PHAL on the desktop but should be portable to PPC and smartphone as it requires only stdio

should work on symbian too as it has an stdio equivalent .i think

if only i could make a decent game with all these free stuff...
I just tried PC build and it seems like it's a crap ;). It looks like it's very slow - tried loading 2000x2000 png, it loaded in no time in irfanview and taken about 3 secs with this project.

It also doesn't seem to support loading from memory.
i tested this decoder on pocketpc and it worked well.

i also tested this on symbian. but it gave weird warning messages before loading the application. the code probably broke some symbian rule somewhere. but it did load the image correctly

...

i found another alternative - LightPng. compiled and ran under symbian without a problem. an advantage is that the zlib code (LightZlib) can be used to inflate compressed files. yohoo!

must load from memory. you will have to read the entire file to memory before processing the it.

another problem - seems to load only a maximum of 128x128 image... tough luck if you have 2000x2000 images :(
i played around with lightzpng and got the code to open a 2000x2000 png file. but it still took 12 seconds to decompress on the pc build :(

...
izeman
Maybe you shall play with pnglib? It's much more useful and fast if you make it work :).
I tried libpngport (made from libpng - the primary tool to work with png's) - it is heavy (as any png loader and especially libpng) + it has problems on some devices.

Of course you can try to clean it from advanced error handling + rare png formats loading.
2000x2000 image file loaded around 3 seconds with release build on the pc ... around the same time it took with infranview

curiosly, on the symbian emulator, the it loaded a 1152x864 image in a blaze.

128x128 image loaded very quickly on actual symbian device.

regarding libpng & zlib - don't get me wrong, they work fine with pocketpc as there are compile configuration for wince. but i haven't seem any symbian port on the web.

i doubt i could make libpng work on symbian - i'll give it a try, when i'm in the mood