|
@@ -70,6 +70,9 @@ static const CGFloat kDestSeemOverlap = 2.0f; // the numbers of pixels to over |
|
@@ -70,6 +70,9 @@ static const CGFloat kDestSeemOverlap = 2.0f; // the numbers of pixels to over |
70
|
case SDImageFormatWebP:
|
70
|
case SDImageFormatWebP:
|
71
|
// Do not support WebP decoding
|
71
|
// Do not support WebP decoding
|
72
|
return NO;
|
72
|
return NO;
|
|
|
73
|
+ case SDImageFormatHEIC:
|
|
|
74
|
+ // Check HEIC decoding compatibility
|
|
|
75
|
+ return [[self class] canDecodeFromHEICFormat];
|
73
|
default:
|
76
|
default:
|
74
|
return YES;
|
77
|
return YES;
|
75
|
}
|
78
|
}
|
|
@@ -80,6 +83,9 @@ static const CGFloat kDestSeemOverlap = 2.0f; // the numbers of pixels to over |
|
@@ -80,6 +83,9 @@ static const CGFloat kDestSeemOverlap = 2.0f; // the numbers of pixels to over |
80
|
case SDImageFormatWebP:
|
83
|
case SDImageFormatWebP:
|
81
|
// Do not support WebP progressive decoding
|
84
|
// Do not support WebP progressive decoding
|
82
|
return NO;
|
85
|
return NO;
|
|
|
86
|
+ case SDImageFormatHEIC:
|
|
|
87
|
+ // Check HEIC decoding compatibility
|
|
|
88
|
+ return [[self class] canDecodeFromHEICFormat];
|
83
|
default:
|
89
|
default:
|
84
|
return YES;
|
90
|
return YES;
|
85
|
}
|
91
|
}
|
|
@@ -470,6 +476,33 @@ static const CGFloat kDestSeemOverlap = 2.0f; // the numbers of pixels to over |
|
@@ -470,6 +476,33 @@ static const CGFloat kDestSeemOverlap = 2.0f; // the numbers of pixels to over |
470
|
return YES;
|
476
|
return YES;
|
471
|
}
|
477
|
}
|
472
|
|
478
|
|
|
|
479
|
++ (BOOL)canDecodeFromHEICFormat {
|
|
|
480
|
+ static BOOL canDecode = NO;
|
|
|
481
|
+ static dispatch_once_t onceToken;
|
|
|
482
|
+ dispatch_once(&onceToken, ^{
|
|
|
483
|
+#if TARGET_OS_SIMULATOR || SD_WATCH
|
|
|
484
|
+ canDecode = NO;
|
|
|
485
|
+#elif SD_MAC
|
|
|
486
|
+ NSProcessInfo *processInfo = [NSProcessInfo processInfo];
|
|
|
487
|
+ if ([processInfo respondsToSelector:@selector(operatingSystemVersion)]) {
|
|
|
488
|
+ // macOS 10.13+
|
|
|
489
|
+ canDecode = processInfo.operatingSystemVersion.minorVersion >= 13;
|
|
|
490
|
+ } else {
|
|
|
491
|
+ canDecode = NO;
|
|
|
492
|
+ }
|
|
|
493
|
+#elif SD_UIKIT
|
|
|
494
|
+ NSProcessInfo *processInfo = [NSProcessInfo processInfo];
|
|
|
495
|
+ if ([processInfo respondsToSelector:@selector(operatingSystemVersion)]) {
|
|
|
496
|
+ // iOS 11+ && tvOS 11+
|
|
|
497
|
+ canDecode = processInfo.operatingSystemVersion.majorVersion >= 11;
|
|
|
498
|
+ } else {
|
|
|
499
|
+ canDecode = NO;
|
|
|
500
|
+ }
|
|
|
501
|
+#endif
|
|
|
502
|
+ });
|
|
|
503
|
+ return canDecode;
|
|
|
504
|
+}
|
|
|
505
|
+
|
473
|
+ (BOOL)canEncodeToHEICFormat {
|
506
|
+ (BOOL)canEncodeToHEICFormat {
|
474
|
static BOOL canEncode = NO;
|
507
|
static BOOL canEncode = NO;
|
475
|
static dispatch_once_t onceToken;
|
508
|
static dispatch_once_t onceToken;
|