Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #17 from thedarkbark/master

Fix for sideways images from camera on iOS 4.x
  • Loading branch information...
commit 8052a42e47671ea775594ea35fc84389ed45a0e6 2 parents d67c12a + f87cfcd
jvanmetre authored
Showing with 6 additions and 1 deletion.
  1. +6 −1 Classes/ELCImagePickerController.m
7 Classes/ELCImagePickerController.m
View
@@ -30,7 +30,12 @@ -(void)selectedAssets:(NSArray*)_assets {
NSMutableDictionary *workingDictionary = [[NSMutableDictionary alloc] init];
[workingDictionary setObject:[asset valueForProperty:ALAssetPropertyType] forKey:@"UIImagePickerControllerMediaType"];
- [workingDictionary setObject:[UIImage imageWithCGImage:[[asset defaultRepresentation] fullScreenImage]] forKey:@"UIImagePickerControllerOriginalImage"];
+ ALAssetRepresentation *assetRep = [asset defaultRepresentation];
+ CGImageRef imgRef = [assetRep fullScreenImage];
+ UIImage *img = [UIImage imageWithCGImage:imgRef
+ scale:assetRep.scale
+ orientation:(UIImageOrientation)assetRep.orientation];
+ [workingDictionary setObject:img forKey:@"UIImagePickerControllerOriginalImage"];
[workingDictionary setObject:[[asset valueForProperty:ALAssetPropertyURLs] valueForKey:[[[asset valueForProperty:ALAssetPropertyURLs] allKeys] objectAtIndex:0]] forKey:@"UIImagePickerControllerReferenceURL"];
[returnArray addObject:workingDictionary];
Please sign in to comment.
Something went wrong with that request. Please try again.