Update:
With iPhone OS 3.0+, the whole UIImagePickerController API has changed. This question and answer should be considered 2.2. legacy code.
When using the UIImagePickerController and you allow editing of the image. The iPhone allows the user to resize and pan the image. However, the max size of an edited image is capped at 320x320.
As an example, I took an iPhone screenshot and placed it in the photo library, which is a 480x320 png. When I use a UIImagePickerController to select that image, even if I do NOT scale or pan the image, it is cropped to 320x320 before it is returned from the UIImagePickerController. However, if I turn editing off, the image is returned the proper 480x320 size.
My theory: Very subtly, the iPhone displays 2 nonstandard translucent tool bars that overlay over the image. These toolbars leave an innocuous 320x320 "window" over the photo. It appears to me that this window effectively clips the underlying photo.
Note: The callback also returns an editing dictionary with the original image and the clipping rect, but of course the rect is also max 320x320.
Any ideas on how to allow images larger than 320x320 to be scaled and panned?
Some code:
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingImage:(UIImage *)img editingInfo:(NSDictionary *)editInfo {
self.myImageView.userInteractionEnabled=YES;
CGRect imageFrame = myImageView.frame;
CGPoint imageCenter = myImageView.center;
imageFrame.size = img.size;
myImageView.frame = imageFrame;
self.myImageView.image = img;
myImageView.center = imageCenter;
[self dismissModalViewControllerAnimated:YES];
[self performSelector:@selector(hideToolBars) withObject:nil afterDelay:2.0];
}