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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T12:50:28+00:00 2026-05-26T12:50:28+00:00

I am using a transparent image with a cut out for a user to

  • 0

I am using a transparent image with a cut out for a user to insert / take their own image. For some reason, while using the UIImagePickerControllerEditedImage and cropping the user-taken photo, the image does not save as it was edited; see photo for example.

My issue is that the image does not save exactly how the photo was edited. (i.e: cropped / resized).

Setting up the UIImagePicker

-(void)choosePhotoDialog:(id)sender
{        
    OverlayView * overlay = [[OverlayView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH_IPHONE, SCREEN_HEIGTH_IPHONE) andPhoto:[dict objectForKey:@"imageUrl"]];
    [overlay setUserInteractionEnabled: NO];

    UIImagePickerController * picker = [[UIImagePickerController alloc] init];
    [picker setSourceType: UIImagePickerControllerSourceTypeCamera];
    [picker setDelegate: self];
    [picker setAllowsImageEditing: YES];
    [picker setShowsCameraControls: YES];
    [picker setNavigationBarHidden: YES];
    [picker setWantsFullScreenLayout: YES];
    [picker setCameraOverlayView: overlay];
    [self presentModalViewController:picker animated:YES];  
    [picker release];
}

After the image is edited:

- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
    SDWebImageManager * manager = [SDWebImageManager sharedManager];
    UIImage * cachedImage  = [manager imageWithURL: [NSURL URLWithString: @"http://www.someurl.com/test.png"]];
    UIImage * userOriginal = [info valueForKey:UIImagePickerControllerEditedImage];

    /*  combining the overlay and the user-photo  */
    UIGraphicsBeginImageContext( CGSizeMake(640,960) );

        /*  for some reason I have to push the user-photo
            down 60 pixels for it to show correctly as it
            was edited.
         */
        [userOriginal drawAtPoint:CGPointMake(0,60)];
        [cachedImage drawAtPoint:CGPointMake(0,0)];

        UIImage * draft = UIGraphicsGetImageFromCurrentImageContext();

    UIGraphicsEndImageContext();

    UIImageWriteToSavedPhotosAlbum( draft, self, @selector(image:didFinishSavingWithError:contextInfo:), nil );       
}

As well, there are white spaces from the editing “crop” portion as demonstrated in the following:

enter image description here

  • 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-26T12:50:29+00:00Added an answer on May 26, 2026 at 12:50 pm

    I believe this is because the edited photo does not include the parts obscured by the semi-transparent framing overlay that is shown as part of the standard iOS image editor. (The 60px you’ve found you must offset by is the 60px of the top half of this overlay.)

    You can extract and expand the UIImagePickerControllerCropRect key from the info dictionary and do the edit again yourself on the UIImagePickerControllerOriginalImage in order to get the resultant image you desire.

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

Sidebar

Related Questions

I'm having some issues while using a transparent PNG image as a background image
I'm using some semi-transparent PNGs as background-images on various websites. These are usually something
I'm using DrawImage() to paint some images on a form with transparent background. Those
Is there a way to hide cursor (other than using transparent image as a
I'm developing a site using jQuery, and jQuery UI tabs. For some reason, my
I am trying to draw a transparent (alpha) PNG image using CxImage, but it
When using a transparent PNG image which has a fine fading shadow always there
How do I check if a PNG image has transparent pixels using PHP's GD
Related to How do I give text or an image a transparent background using
I'm using semi-transparent PNGs (due to the designer's overlapping of elements) and trying to

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.