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

  • SEARCH
  • Home
  • 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 6884035
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T05:27:29+00:00 2026-05-27T05:27:29+00:00

So I am making a call to pull an image from a photo server

  • 0

So I am making a call to pull an image from a photo server using Nimbus’ NINetworkImageView object. I need to check if the object returned is valid. If it is not valid, the method

- (void) networkImageView:(NINetworkImageView *) imageView didLoadImage:(UIImage *) image {

returns a transparent UIImage object. I think the method is returning me a jpg image with clear pixels which is causing me the issue. I have tried the following checks to see if the image is transparent with no luck (All of the attempts below happen in the scope of the method above):

Failed Attempt 1:

UIImageView *tempView = [[UIImageView alloc] initWithImage:image]; 
if(tempView.alpha != 0.0f)
{   
    //the image is a valid (nonclear) image
}
else
{
     //the image is invalid (clear)
}

Failed Attempt 2:

CGImageRef cgref = [[UIImage alloc] CGImage];
CIImage *cim = [[UIImage alloc] CIImage];

if(!([image CIImage] == cim && [image CGImage] == cgref))
{   
     //the image is a valid (nonclear) image
}
else
{
     //the image is invalid (clear)
}

Failed Attempt 3:

if(image)
{   
     //the image is a valid (nonclear) image
}
else
{
     //the image is invalid (clear)
}

Failed Attempt 4:

CGImageRef cgref = [image CGImage];
CIImage *cim = [image CIImage];

if(cim == nil && cgref == NULL)
{         
    //the image is invalid (clear)  
}
else
{
    //the image is a valid (nonclear) image
}

Edit

I was able to pull the “Invalid image” from the simulator. The networkimageview method is returning a jpg image that is completely white. However, in the simulator it shows up as a clear picture, thoughts?

  • 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-05-27T05:27:29+00:00Added an answer on May 27, 2026 at 5:27 am

    I can advice to save this image to disk and see it’s alpha value in Photoshop/another graphic tool.

    UIImageWriteToSavedPhotosAlbum(image, nil, nil, NULL);
    

    Now you can find this image in Photos app.

    The following function saves UIImage with name image.png file in the user Document folder:

    - (void)saveImage: (UIImage*)image
    {
        if (image != nil)
        {
            NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, 
                          NSUserDomainMask, YES);
            NSString *documentsDirectory = [paths objectAtIndex:0];
            NSString* path = [documentsDirectory stringByAppendingPathComponent: 
                           [NSString stringWithString: @"test.png"] ];
            NSData* data = UIImagePNGRepresentation(image);
            [data writeToFile:path atomically:YES];
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When making a call to a web service running on a server using HTTPS
My node.js server is making a call to another server using the latest (0.4.8)
I'm making a call to a program from the shell using the subprocess module
I am making a call to a server which returns a JSON encoded object.
I'm making call to Alfresco Webscripts which return JSON. I do this using GET
I have a main page from where I am making a call to load
I've got an html page from where Im making this call periodically: function logon(id)
I am using a third-party application, and making a call to create an instance
Im making an asynchronous call from a class to another. Here is my actual
Suppose I'm making a JDBC call and I had fetched data from a database

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.