Updated encoder for libpng changes.
Merge pull request #1178 from seanpaultaylor/next

Updated encoder for libpng changes.