I'm trying to show an image taken through the camera in Portrait mode but I always get it shown on my UIImageView in Landascape mode. The image is scaled before being added to the UIImageView but it seems this is not the problem as I tried many different solutions found on the web (even some quite smart ones like the one coming from Trevor's Bike Shed).
Here is my code:
UIImage *image = [UIImage imageWithContentsOfFile:imgPath];
CGRect newFrame = [scrollView frame];
UIImage *resizedImage = [ImageViewController imageFromImage:image scaledToSize:newFrame.size];
imageView = [[UIImageView alloc] initWithFrame:newFrame];
[imageView setImage:resizedImage];
[scrollView setContentSize:imageView.frame.size];
[scrollView addSubview:imageView];
[imageView release];
imgPath is the path of the image coming as a parameter and scrollView is an IBOutlet linked to a UIScrollView.
Is there something I'm missing about the UIImageView? As I wrote above, it seems that the problem is not related to the scaling...