Permalink
Browse files

Return a properly oriented image in the working dict.

  • Loading branch information...
1 parent 3894cf2 commit 1f7e4e462af06dbba5f9111eb5235bfe45caee0c James Van Metre committed Apr 2, 2013
Showing with 2 additions and 1 deletion.
  1. +2 −1 Classes/ELCImagePicker/ELCImagePickerController.m
@@ -32,10 +32,11 @@ - (void)selectedAssets:(NSArray *)assets
NSMutableDictionary *workingDictionary = [[NSMutableDictionary alloc] init];
[workingDictionary setObject:[asset valueForProperty:ALAssetPropertyType] forKey:@"UIImagePickerControllerMediaType"];
ALAssetRepresentation *assetRep = [asset defaultRepresentation];
+
CGImageRef imgRef = [assetRep fullScreenImage];
UIImage *img = [UIImage imageWithCGImage:imgRef
scale:[UIScreen mainScreen].scale
- orientation:(UIImageOrientation)assetRep.orientation];
+ orientation:UIImageOrientationUp];
[workingDictionary setObject:img forKey:@"UIImagePickerControllerOriginalImage"];
[workingDictionary setObject:[[asset valueForProperty:ALAssetPropertyURLs] valueForKey:[[[asset valueForProperty:ALAssetPropertyURLs] allKeys] objectAtIndex:0]] forKey:@"UIImagePickerControllerReferenceURL"];

0 comments on commit 1f7e4e4

Please sign in to comment.