Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

printz

macrumors regular
Original poster
Dec 23, 2012
218
0
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.
 
Last edited:
Alright thanks. I'd use the Cocoa API too, though I'd have to get rid of old libpng code first…
 
Alright thanks. I'd use the Cocoa API too, though I'd have to get rid of old libpng code first…

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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.