Apparently, some time ago, libpng made the png_info structure opaque. OSX has a newer version on libpng, so matplotlib would not compile. Attached is the _png.cpp that fixes this issue, I changed it to use the new libpng access routines.
This issue will certainly come up on any platform with newer libpng versions.
_png.cpp (13.4 KB)