|
@@ -98,20 +98,7 @@ static const CGFloat kDestSeemOverlap = 2.0f; // the numbers of pixels to over |
|
@@ -98,20 +98,7 @@ static const CGFloat kDestSeemOverlap = 2.0f; // the numbers of pixels to over |
98
|
|
98
|
|
99
|
UIImage *image = [[UIImage alloc] initWithData:data];
|
99
|
UIImage *image = [[UIImage alloc] initWithData:data];
|
100
|
|
100
|
|
101
|
-#if SD_MAC
|
|
|
102
|
return image;
|
101
|
return image;
|
103
|
-#else
|
|
|
104
|
- if (!image) {
|
|
|
105
|
- return nil;
|
|
|
106
|
- }
|
|
|
107
|
-
|
|
|
108
|
- UIImageOrientation orientation = [[self class] sd_imageOrientationFromImageData:data];
|
|
|
109
|
- if (orientation != UIImageOrientationUp) {
|
|
|
110
|
- image = [[UIImage alloc] initWithCGImage:image.CGImage scale:image.scale orientation:orientation];
|
|
|
111
|
- }
|
|
|
112
|
-
|
|
|
113
|
- return image;
|
|
|
114
|
-#endif
|
|
|
115
|
}
|
102
|
}
|
116
|
|
103
|
|
117
|
- (UIImage *)incrementallyDecodedImageWithData:(NSData *)data finished:(BOOL)finished {
|
104
|
- (UIImage *)incrementallyDecodedImageWithData:(NSData *)data finished:(BOOL)finished {
|
|
@@ -517,31 +504,6 @@ static const CGFloat kDestSeemOverlap = 2.0f; // the numbers of pixels to over |
|
@@ -517,31 +504,6 @@ static const CGFloat kDestSeemOverlap = 2.0f; // the numbers of pixels to over |
517
|
}
|
504
|
}
|
518
|
|
505
|
|
519
|
#if SD_UIKIT || SD_WATCH
|
506
|
#if SD_UIKIT || SD_WATCH
|
520
|
-#pragma mark EXIF orientation tag converter
|
|
|
521
|
-+ (UIImageOrientation)sd_imageOrientationFromImageData:(nonnull NSData *)imageData {
|
|
|
522
|
- UIImageOrientation result = UIImageOrientationUp;
|
|
|
523
|
- CGImageSourceRef imageSource = CGImageSourceCreateWithData((__bridge CFDataRef)imageData, NULL);
|
|
|
524
|
- if (imageSource) {
|
|
|
525
|
- CFDictionaryRef properties = CGImageSourceCopyPropertiesAtIndex(imageSource, 0, NULL);
|
|
|
526
|
- if (properties) {
|
|
|
527
|
- CFTypeRef val;
|
|
|
528
|
- NSInteger exifOrientation;
|
|
|
529
|
- val = CFDictionaryGetValue(properties, kCGImagePropertyOrientation);
|
|
|
530
|
- if (val) {
|
|
|
531
|
- CFNumberGetValue(val, kCFNumberNSIntegerType, &exifOrientation);
|
|
|
532
|
- result = [SDWebImageCoderHelper imageOrientationFromEXIFOrientation:exifOrientation];
|
|
|
533
|
- } // else - if it's not set it remains at up
|
|
|
534
|
- CFRelease((CFTypeRef) properties);
|
|
|
535
|
- } else {
|
|
|
536
|
- //NSLog(@"NO PROPERTIES, FAIL");
|
|
|
537
|
- }
|
|
|
538
|
- CFRelease(imageSource);
|
|
|
539
|
- }
|
|
|
540
|
- return result;
|
|
|
541
|
-}
|
|
|
542
|
-#endif
|
|
|
543
|
-
|
|
|
544
|
-#if SD_UIKIT || SD_WATCH
|
|
|
545
|
+ (BOOL)shouldScaleDownImage:(nonnull UIImage *)image {
|
507
|
+ (BOOL)shouldScaleDownImage:(nonnull UIImage *)image {
|
546
|
BOOL shouldScaleDown = YES;
|
508
|
BOOL shouldScaleDown = YES;
|
547
|
|
509
|
|