Become a MacRumors Supporter for $25/year with no ads, private forums, and more!

printz

macrumors regular
Original poster
Dec 23, 2012
216
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.
 

gnasher729

Suspended
Nov 25, 2005
17,980
5,558
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:

printz

macrumors regular
Original poster
Dec 23, 2012
216
0
Alright thanks. I'd use the Cocoa API too, though I'd have to get rid of old libpng code first…
 

mrichmon

macrumors 6502a
Jun 17, 2003
873
3
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.
 

chown33

Moderator
Staff member
Aug 9, 2009
9,538
6,199
the Abysmal Plane
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.