Merge pull request #819 from n13/master

guarding against image source == NULL
This commit is contained in:
Bogdan Poplauschi 2014-07-18 16:21:16 +03:00
commit 681a7c4222
1 changed files with 15 additions and 13 deletions

View File

@ -47,6 +47,7 @@
+(UIImageOrientation)sd_imageOrientationFromImageData:(NSData *)imageData {
UIImageOrientation result = UIImageOrientationUp;
CGImageSourceRef imageSource = CGImageSourceCreateWithData((__bridge CFDataRef)imageData, NULL);
if (imageSource) {
CFDictionaryRef properties = CGImageSourceCopyPropertiesAtIndex(imageSource, 0, NULL);
if (properties) {
CFTypeRef val;
@ -61,6 +62,7 @@
//NSLog(@"NO PROPERTIES, FAIL");
}
CFRelease(imageSource);
}
return result;
}