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

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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T17:13:34+00:00 2026-05-25T17:13:34+00:00

In my efforts to improve my apps, I need to check the width and

  • 0

In my efforts to improve my apps, I need to check the width and height of a UIImage object.

The problem is the inconsistent data that I am getting from .size.width (and height)property.

If an image is landscape, then the image.size.width returns its width fine. But when the image is portrait, the image.size.width returns its height instead. I find this funny.

I could easily swap this value to correct it, but I want to know what’s wrong as well. Is this a bug or am I doing it wrong?

Here is how I am retrieving the image properties:

float w = bigImage.size.width;
float h = bigImage.size.height;

NSLog(@"%.2f, %.2f", w,h);

I’ve tested this both in simulator and in my iPhone4, and both give the same result.

Any ideas why? Thanks

  • 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-25T17:13:34+00:00Added an answer on May 25, 2026 at 5:13 pm

    I just figured it out. the .size.width were indeed returning the correct values. But it was an earlier method that somehow rotated the image to landscape upon saving to sandbox. That method was written to save the image to the app sandbox raw direct from the camera/photo albums. I added a parsing method to preprocess the full res image before saving to the sandbox, and now it works.

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

Sidebar

Related Questions

I am continuing my efforts with data pulled from a mainframe. Currently, I am
In an effort to improve the image quality I'm getting from a camera I
I've exhausted all efforts at what appears to be a trivial problem, but gotten
Very occasionally, despite all testing efforts, I get hit with a bug report from
Wow crazy title! But here's the problem. In efforts to dry up my school
I need to automate the migration from an Access (2003) to an SQL Server
In my efforts to solve a rounding problem I've broken the dynamic updating of
I know that a lot of Y2K efforts/scare was somehow centered on COBOL, deservedly
I have the following SQL statement: SELECT efforts.user_id, project_tasks.task_name, sum(hours) FROM efforts, users, project_tasks
I need to get numerical data to display as a chart on a webpage,

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.