I am using
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingImage:(UIImage *)image editingInfo:(NSDictionary *)editingInfo
to take the image.
Then use
CGImageRef imgRef = image.CGImage; CGFloat width = CGImageGetWidth(imgRef); CGFloat height = CGImageGetHeight(imgRef);
For some reason, the width always 640, and height always 480. no matter whether it is portrait or landscape.
I really confused on that, I thought in portraint, it should be width 320 and height is 480, while in landscape mode, width should be 480 and height should be 320.
What am I missing? How do I get correct width and height of the image. Thanks.