Does OS X come with libpng pre-installed?

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

  1. printz macrumors regular

    Joined:
    Dec 23, 2012
    #1
    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

    gnasher729

    Joined:
    Nov 25, 2005
    #2
    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

    Joined:
    Dec 23, 2012
    #3
    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

    Joined:
    Jun 17, 2003
    #4
    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

    Joined:
    Aug 9, 2009
    #5
    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