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 7987515
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T12:10:18+00:00 2026-06-04T12:10:18+00:00

i encountered a weird error. i will like the app to save an image

  • 0

i encountered a weird error. i will like the app to save an image into camera roll.

but a small amount of device are giving me error saving msg.

EDIT: ERROR Log

“Failed to encode image for saved photos.” UserInfo=0x3e7170 {NSUnderlyingError=0x389310 “Failed to encode image for saved photos.”, NSLocalizedDescription=Failed to encode image for saved photos.

May 22 14:13:34 unknown assetsd[281] <Error>: ImageIO: CGImageDestinationAddImage image parameter is nil
May 22 14:13:34 unknown assetsd[281] <Error>: ImageIO: CGImageDestinationFinalize image destination does not have enough images
May 22 14:13:34 unknown assetsd[281] <Error>: CGContextTranslateCTM: invalid context 0x0
May 22 14:13:34 unknown assetsd[281] <Error>: CGContextScaleCTM: invalid context 0x0
May 22 14:13:34 unknown assetsd[281] <Error>: CGContextSetBaseCTM: invalid context 0x0
May 22 14:13:34 unknown assetsd[281] <Error>: CGContextSaveGState: invalid context 0x0
May 22 14:13:34 unknown assetsd[281] <Error>: CGContextSetInterpolationQuality: invalid context 0x0
May 22 14:13:34 unknown assetsd[281] <Error>: CGContextTranslateCTM: invalid context 0x0
May 22 14:13:34 unknown assetsd[281] <Error>: CGContextScaleCTM: invalid context 0x0
May 22 14:13:34 unknown assetsd[281] <Error>: CGContextSetFillColorWithColor: invalid context 0x0
May 22 14:13:34 unknown assetsd[281] <Error>: CGContextFillRects: invalid context 0x0
May 22 14:13:34 unknown assetsd[281] <Error>: CGContextTranslateCTM: invalid context 0x0
May 22 14:13:34 unknown assetsd[281] <Error>: CGContextScaleCTM: invalid context 0x0
May 22 14:13:34 unknown com.apple.assetsd[281] <Notice>: May 22 14:13:34 SLQ-iTouch assetsd[281] <Error>: CGContextTranslateCTM: invalid context 0x0
May 22 14:13:34 unknown com.apple.assetsd[281] <Notice>: May 22 14:13:34 SLQ-iTouch assetsd[281] <Error>: CGContextScaleCTM: invalid context 0x0
May 22 14:13:34 unknown com.apple.assetsd[281] <Notice>: May 22 14:13:34 SLQ-iTouch assetsd[281] <Error>: CGContextSetBaseCTM: invalid context 0x0
May 22 14:13:34 unknown com.apple.assetsd[281] <Notice>: May 22 14:13:34 SLQ-iTouch assetsd[281] <Error>: CGContextSaveGState: invalid context 0x0
May 22 14:13:34 unknown com.apple.assetsd[281] <Notice>: May 22 14:13:34 SLQ-iTouch assetsd[281] <Error>: CGContextSetInterpolationQuality: invalid context 0x0
May 22 14:13:34 unknown com.apple.assetsd[281] <Notice>: May 22 14:13:34 SLQ-iTouch assetsd[281] <Error>: CGContextTranslateCTM: invalid context 0x0
May 22 14:13:34 unknown com.apple.assetsd[281] <Notice>: May 22 14:13:34 SLQ-iTouch assetsd[281] <Error>: CGContextScaleCTM: invalid context 0x0
May 22 14:13:34 unknown com.apple.assetsd[281] <Notice>: May 22 14:13:34 SLQ-iTouch assetsd[281] <Error>: CGContextSetFillColorWithColor: invalid context 0x0
May 22 14:13:34 unknown com.apple.assetsd[281] <Notice>: May 22 14:13:34 SLQ-iTouch assetsd[281] <Error>: CGContextFillRects: invalid context 0x0
May 22 14:13:34 unknown com.apple.assetsd[281] <Notice>: May 22 14:13:34 SLQ-iTouch assetsd[281] <Error>: CGContextTranslateCTM: invalid context 0x0
May 22 14:13:34 unknown com.apple.assetsd[281] <Notice>: May 22 14:13:34 SLQ-iTouch assetsd[281] <Error>: CGContextScaleCTM: invalid context 0x0
May 22 14:13:34 unknown assetsd[281] <Error>: CGContextTranslateCTM: invalid context 0x0
May 22 14:13:34 unknown assetsd[281] <Error>: CGContextTranslateCTM: invalid context 0x0
May 22 14:13:34 unknown assetsd[281] <Error>: CGContextTranslateCTM: invalid context 0x0
May 22 14:13:34 unknown assetsd[281] <Error>: CGContextConcatCTM: invalid context 0x0
May 22 14:13:34 unknown assetsd[281] <Error>: CGContextTranslateCTM: invalid context 0x0
May 22 14:13:34 unknown assetsd[281] <Error>: CGContextDrawImage: invalid context 0x0
May 22 14:13:34 unknown com.apple.assetsd[281] <Notice>: May 22 14:13:34 SLQ-iTouch assetsd[281] <Error>: CGContextTranslateCTM: invalid context 0x0
May 22 14:13:34 unknown com.apple.assetsd[281] <Notice>: May 22 14:13:34 SLQ-iTouch assetsd[281] <Error>: CGContextTranslateCTM: invalid context 0x0
May 22 14:13:34 unknown com.apple.assetsd[281] <Notice>: May 22 14:13:34 SLQ-iTouch assetsd[281] <Error>: CGContextTranslateCTM: invalid context 0x0
May 22 14:13:34 unknown com.apple.assetsd[281] <Notice>: May 22 14:13:34 SLQ-iTouch assetsd[281] <Error>: CGContextConcatCTM: invalid context 0x0
May 22 14:13:34 unknown com.apple.assetsd[281] <Notice>: May 22 14:13:34 SLQ-iTouch assetsd[281] <Error>: CGContextTranslateCTM: invalid context 0x0
May 22 14:13:34 unknown com.apple.assetsd[281] <Notice>: May 22 14:13:34 SLQ-iTouch assetsd[281] <Error>: CGContextDrawImage: invalid context 0x0
May 22 14:13:34 unknown assetsd[281] <Error>: CGContextRestoreGState: invalid context 0x0
May 22 14:13:34 unknown assetsd[281] <Error>: CGBitmapContextCreateImage: invalid context 0x0
May 22 14:13:34 unknown com.apple.assetsd[281] <Notice>: May 22 14:13:34 SLQ-iTouch assetsd[281] <Error>: CGContextRestoreGState: invalid context 0x0
May 22 14:13:34 unknown com.apple.assetsd[281] <Notice>: May 22 14:13:34 SLQ-iTouch assetsd[281] <Error>: CGBitmapContextCreateImage: invalid context 0x0
> 

below are my code used to save the images.

- (IBAction)saveImage:(id)sender {

    HUD = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
    HUD.dimBackground = YES;
    HUD.labelText = @"Its saving!";
    self.imageOverlay.alpha = 1;
    self.savedImage = [self maskImage:self.imgView withMask:self.baseImgView];

    UIImageWriteToSavedPhotosAlbum(self.savedImage, self, @selector(imageSavedToPhotosAlbum: didFinishSavingWithError: contextInfo:), nil);
}

- (void)imageSavedToPhotosAlbum:(UIImage *)image didFinishSavingWithError:(NSError *)error contextInfo:(void *)contextInfo {

    NSString *message;
    NSString *title;

    if (!error) {
        title = NSLocalizedString(@"Save Success", @"");
        message = NSLocalizedString(@"Save Success Message", @"");
        HUD.customView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Checkmark.png"]];
        HUD.mode = MBProgressHUDModeCustomView; 
        HUD.labelText = @"We’re saved - WooHoo!!";
        [HUD hide:YES afterDelay:1.5];
        saved =1;
        self.imageOverlay.alpha =0.85;
        [self performSelector:@selector(saveSuccess) withObject:nil afterDelay:1.5];


    } else 
    {
        title = NSLocalizedString(@"Save Failed", @"");
        message = [error description];

        HUD.customView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"sad_face.png"]];
        HUD.mode = MBProgressHUDModeCustomView;
        HUD.labelText = @"Error! Try saving photo again :p";
        [HUD hide:YES afterDelay:3];
    }
}

- (UIImage*) maskImage:(UIImageView *)maskImage withMask:(UIImageView *)cropImage
{

    UIImage *image = nil;
    UIImage *imagePNG = nil;

    CGSize newImageSize = CGSizeMake(cropImage.frame.size.width, cropImage.frame.size.height);

    UIGraphicsBeginImageContextWithOptions(newImageSize, NO, 0.0); //retina res
    [self.viewForImg.layer renderInContext:UIGraphicsGetCurrentContext()];

    image = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();    

    NSData *imgData =  UIImagePNGRepresentation ( image ); // get PNG representation
    imagePNG = [UIImage imageWithData:imgData]; // wrap UIImage around PNG representation
    return imagePNG;
}
  • 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-04T12:10:20+00:00Added an answer on June 4, 2026 at 12:10 pm
    - (UIImage*) maskImage:(UIImageView *)maskImage withMask:(UIImageView *)cropImage
    {
    
        UIImage *image = nil;
        UIImage *imagePNG = nil;
    
        CGSize newImageSize = CGSizeMake(cropImage.frame.size.width, cropImage.frame.size.height);
    
        UIGraphicsBeginImageContextWithOptions(newImageSize, NO, 0.0); //retina res
        [self.viewForImg.layer renderInContext:UIGraphicsGetCurrentContext()];
    
        image = UIGraphicsGetImageFromCurrentImageContext();
    
        NSData *imgData =  UIImagePNGRepresentation ( image ); // get PNG representation
        imagePNG = [UIImage imageWithData:imgData]; // wrap UIImage around PNG representation
        UIGraphicsEndImageContext();    
    
        return imagePNG;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just encountered a weird error which saying that find is not a member
Sometimes it is weird to encounter File not Found Error in running. But we
I encountered a weird error, I lose sessions when moving between pages. I just
I've just encountered a weird problem, I'm trying to printf an integer variable, but
I have encountered a weird situation while updating/upgrading some legacy code. I have a
I'm making a bookmarklet, but I've encountered some wierd behaviour in IE8. The code
I'm encountered something weird, and I'm not sure if it's a bug in Visual
Maybe my question might seem a bit weird, but I have an activity in
I've encountered weird Eclipse console output during my application execution. I'm almost 100% sure
I've encountered a weird behavior when trying to use a thumb to move a

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.