I think I found a bug in latest iOS 7 by running an app with Base SDK set to iOS 6.1 (possibly even lower versions too, haven't tested that out yet)
I have this image in my photo library: http://i.imgur.com/7KUIGLt.jpg
I present a UIImagePickerController via:
UIImagePickerController *vc = [[UIImagePickerController alloc] init];
vc.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
vc.delegate = self;
vc.allowsEditing = YES;
[self presentViewController:vc animated:YES completion:nil];
I save the chosen image to my desktop (I am running this on simulator, but this works on device too)
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
UIImage* outputImage = [info objectForKey:UIImagePickerControllerEditedImage];
if (outputImage == nil) {
outputImage = [info objectForKey:UIImagePickerControllerOriginalImage];
}
NSData *d = UIImagePNGRepresentation(outputImage);
[d writeToFile:@"/Users/Admin/Desktop/test.png" atomically:YES];
[self dismissViewControllerAnimated:YES completion:nil];
}
This is the resulting image:
Notice the big black bar to the right. What's causing this?
To reproduce this, you need:
- iOS 7
- App with Base SDK set to 6.1 (maybe even lower SDKs too, i haven't tried yet)
- iPhone 5/5c/5s
- Only happens to pictures that were taken with iPhone 5/5c/5s camera (you can use the original image I linked above for testing)
NOTE: Just to be clear, the black bar is part of the actual image. The image you see there is not a screenshot of a UIImageView, but the actual image saved to disk and uploaded here...
UIImagePickerControllerSourceTypePhotoLibrary
, so it does seem you are not using the actual camera, but picking up images from the library. Right ? – Lefteris