Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8006583
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T17:33:37+00:00 2026-06-04T17:33:37+00:00

Ever since I updated to 10.7.4 I started having issues with my NSImage code.

  • 0

Ever since I updated to 10.7.4 I started having issues with my NSImage code. When I read out the representations of an image, select the Bitmap image representation and try to write it out to a PNG file I receive an error.

Therefore I tried doing it through the ‘regular’ way, with the following errors:

enter image description here

My first guess would be removing the broken version of libPNG and replacing it with a working one. Any suggestions on how I should tackle this problem? I could try compiling an old version of libPNG and read out the bitmap image and write it out myself.
Love it how the quality of OSX degraded to the level of windows vista in Lion.

And yes, OSX uses libPNG: http://d.pr/i/nOEX

To clarify it a bit more, here is my test build code:

NSImage *image = [[NSImage alloc] initWithContentsOfFile:@"/Users/jabwd/Desktop/Icons/4099.ico"];

    NSLog(@"%@",[image representations]);
    NSImageRep *biggest = nil;
    for(NSImageRep *rep in [image representations])
    {
        if( ! biggest )
        {
            biggest = rep;
        }
        else if( [rep size].width >= [biggest size].width && [rep size].height >= [biggest size].height )
        {
            biggest = rep;
        }
    }

    if( biggest && [biggest isKindOfClass:[NSBitmapImageRep class]] )
    {
        NSBitmapImageRep *bitmap = (NSBitmapImageRep *)biggest;
        NSData *data = [bitmap representationUsingType:NSPNGFileType properties:nil];
        [data writeToFile:@"/Users/jabwd/Desktop/test.png" atomically:false];
    }

As you can see I assume there are multiple representations in the image. I can do this in this case because there is a certain type of icons I’m loading, its a private project and won’t get into the hands of some users => there is a certain task for another bigger application I have which needs to be automated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T17:33:39+00:00Added an answer on June 4, 2026 at 5:33 pm

    Looks like ImageIO.framework has a few bugs in 10.7.4, its the same libPNG version found on 10.7.3. Using an automator script to convert the images to jpegs before converting them to pngs seems to be working.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been a Microsoft developer ever since I started programming... I started out by
Ever since I upgraded to Delphi 2009, I am having terrible experience with TFrame
Ever since I started programming this has been something I have been curious about.
Ever since I started coding back in 2008 I was addicted to it and
I am facing a very strange issue ever since I updated the Xcode with
Ever since I updated FF to 3.6.12 (or at least that's when I noticed
Greetings all, This has confused me ever since I first started coding in C#.
I just updated my NuGet Package Manager on my corporate machine. Ever since the
Ever since I found out about auto properties, I try to use them everywhere.
Ever since I updated my projects for VS 11 I can't get my @Model

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.