iteration port libapng by maxst at users.sourceforge.net