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

The Archive Base Latest Questions

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

I am developing an Application where I am capturing image in portrait mode and

  • 0

I am developing an Application where I am capturing image in portrait mode and then moving to another class with Image data and showing that image in a UIImageView on a UIScrollView.

Now If I am taking image form library,it is working fine, but If I have to capture an Image it is showing data in landscape mode. Below is my code of both classes. :

Class 1:

- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
    NSData *imgData = UIImagePNGRepresentation([info objectForKey:@"UIImagePickerControllerOriginalImage"]);

    [picker dismissModalViewControllerAnimated:YES];
        image = [[UIImage alloc] initWithData:imgData];

    CGImageRef imgRefCrop = image.CGImage;
            UIImage *photo = [UIImage imageWithCGImage:imgRefCrop];

    PhotoCropperPage *photoCropper = [[PhotoCropperPage alloc] 
                                           initWithPhoto:photo
                                                 delegate:self                                                  
                uiMode:PCPUIModePresentedAsModalViewController
                                          showsInfoButton:YES];

    [photoCropper setMinZoomScale:0.3f];
    [photoCropper setMaxZoomScale:4.0f];
    [self.navigationController pushViewController:photoCropper animated:YES];
}

Class 2:

- (void) loadPhoto
{
    if (self.photo == nil) {
        return;
    }

    CGFloat w = self.photo.size.width;
    CGFloat h = self.photo.size.height;

    CGRect imageViewFrame = CGRectMake(0.0f, 0.0f, roundf(w / 2.0f), roundf(h / 2.0f));
    self.scrollView.contentSize = imageViewFrame.size;

    UIImageView *iv = [[UIImageView alloc] initWithFrame:imageViewFrame];
    iv.image = self.photo;
    [self.scrollView addSubview:iv];
    self.imageView = iv;
    [iv release];
}

I am not getting where I am doing a mistake? Can anybody point me out? Thanks in advance.

  • 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-28T03:26:52+00:00Added an answer on May 28, 2026 at 3:26 am

    Just found an awesome answer to your question. Here’s the link: https://stackoverflow.com/a/5427890/1047258

    And then you can do something like that:

    - (void) imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
    {
      UIImage *theImage = [[info objectForKey:@"UIImagePickerControllerOriginalImage"]fixOrientation];
      //rest of your code
    }
    

    and theImage will be your image with correct orientation. It worked in my project

    Hope it helps.

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

Sidebar

Related Questions

i'm developing application that is listening to the data coming to the pc and
I'm developing an application just for fun that consists of capturing images from a
I'm developing application with GWT 2 and would like to add float panel that
When developing an application that sends out notification email messages, what are the best
I'm developing application that will read messages from IMAP server.. what would you recommend
I am developing application using Entity Framework. When i'm in debugging mode my test
I am developing Mac desktop application, where I am capturing the screen using CGImageRef
I am developing application in N-Tier Architecture. as we all know that we need
I'm developing application that would communicate with a mobile app. My problem is as
I am currently developing application that does following: Read Inbox (using MAPI) & SMS

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.