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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T05:08:31+00:00 2026-06-01T05:08:31+00:00

I am receiving my UIImage ‘s from AVCaptureSession and setting them into UIImageView ‘s.

  • 0

I am receiving my UIImage‘s from AVCaptureSession and setting them into UIImageView‘s. The portrait mode sets images with correct orientation but once I use landscape mode the images are set rotated 90 degrees clockwise.

I did a little research and discovered that I can use UIImageOrientation with this method to resolve my issue:

[UIImage imageWithCGImage:cgimageref scale:1 orientation:orientation]

But I do not understand how. If I look at UIImageOrientation on all images, the value is always 3 (NSLog(@"%d",UIImageOrientation)) in both portrait and landscape modes. I am puzzled about how this can help me. Am I missing something?

Here is orientation code:

-(void) didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation{
  self.prevLayer.frame = self.view.bounds;
  self.prevLayer.orientation = [[UIDevice currentDevice] orientation];
}

shouldAutorotateToInterfaceOrientation returns YES.

  • 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-01T05:08:32+00:00Added an answer on June 1, 2026 at 5:08 am

    The solution took some time to find. I had to add orientation to AVCaptureConnection

    AVCaptureConnection *videoConnection = nil;
    for (AVCaptureConnection *connection in stillImageOutput.connections){
        for (AVCaptureInputPort *port in [connection inputPorts]){
            if ([[port mediaType] isEqual:AVMediaTypeVideo] ){
                videoConnection = connection;
                break;
            }
        }
        if (videoConnection) { break; }
    }
    

    This line below is the fix:

    if([videoConnection isVideoOrientationSupported]) {
        [videoConnection setVideoOrientation:[[UIDevice currentDevice] orientation]];
    }
    

    And all images work right with any orientation.

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

Sidebar

Related Questions

I am receiving images from xml feed they are very large in size how
Hi I was receiving responses from an API as JSON and loading it into
I'm receiving feedback from a developer that The only way visual basic (6) can
I am receiving a large list of current account numbers daily, and storing them
receiving error: PHP Notice: Undefined index: mode in /web/ee_web/include/form-modal.php on line 51 line 51
After receiving very good correction from fuzzy lollipop, I amended my code to create
When receiving an incoming msessage I receive a correct result when my packet structure
Receiving a segfault when running this very short script in Ubuntu. from osgeo import
After receiving push notification app icon not display badge. In setting notification is on,
When receiving an array from flash, in C, how do I populate that array

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.