Does OS X have libpng.dylib available out-of-the-box, or should I supply it with the dependent program that I distribute? I know it has zlib (libz.dylib) in /usr/lib.
Does OS X have libpng.dylib available out-of-the-box, or should I supply it with the dependent program that I distribute? I know it has zlib (libz.dylib) in /usr/lib.
I'd not use libpng in the first place. NSImage will handle lots of different image formats (including .png); there is no need to go back to a low-level library that supports only one format.
And no, it's not there. Because there is no need to use it.
BTW, there are plenty of good reasons to stay with libpng rather than switching to a Cocoa API. The most common is a) implementation already exists and has been tested and verified. Another good reason: wanting to support multiple platforms with the same codebase.
If the goal is to be compatible with libpng's API, then simply distribute your app with libpng linked in. It's not hard to put dependent dylibs into an app bundle, and have the code reference the bundle-resident dylib.