I've created a picture indexing service (local, Facebook, Picassa, Instagram, etc).
In the collection view, a double-tap will pop the image out of the cell to become full-sized. For local sources, it sometimes uses the wrong orientation. . How can I force it to use the orientation of the device (landscape), even if the photo makes a better fit in potrait mode?
Here's the method to load the indexed asset from the local assets library:
- (void)performLoadFor:(GTPImage*)image onSuccess:(void (^)(UIImage*))onSuccess onError:(void (^)(NSError*))onError
{
[_assetsLibrary assetForURL:[NSURL URLWithString:image.address] resultBlock:^(ALAsset* asset)
{
if (onSuccess)
{
CGImageRef imageRef = [[asset defaultRepresentation] fullResolutionImage];
onSuccess([UIImage imageWithCGImage:imageRef]);
}
} failureBlock:^(NSError* error)
{
onError(error);
}];
}