iteration port libapng from maxst.users.sourceforge.net