Does OS X come with libpng pre-installed?

Discussion in 'Mac Programming' started by printz, Nov 6, 2013.

  1. printz macrumors regular

    Dec 23, 2012
    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.
  2. gnasher729, Nov 6, 2013
    Last edited: Nov 6, 2013

    gnasher729 macrumors P6


    Nov 25, 2005
    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.
  3. printz thread starter macrumors regular

    Dec 23, 2012
    Alright thanks. I'd use the Cocoa API too, though I'd have to get rid of old libpng code first…
  4. mrichmon macrumors 6502a

    Jun 17, 2003
    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.
  5. chown33 macrumors 604

    Aug 9, 2009
    Sailing beyond the sunset
    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.

Share This Page