Remove the HEIC coder from default coder list. Since it contains performance issue and may block main thread. Needs to check in the future iOS release

This commit is contained in:
DreamPiggy 2019-09-27 11:37:48 +08:00
parent 46bdb3b8c1
commit d91ea19768
3 changed files with 4 additions and 6 deletions

View File

@ -17,10 +17,10 @@
Note: the `coders` getter will return the coders in their reversed order
Example:
- by default we internally set coders = `IOCoder`, `GIFCoder`, `APNGCoder`, 'HEICCoder' (iOS 11+)
- calling `coders` will return `@[IOCoder, GIFCoder, APNGCoder, HEICCoder]`
- by default we internally set coders = `IOCoder`, `GIFCoder`, `APNGCoder`
- calling `coders` will return `@[IOCoder, GIFCoder, APNGCoder]`
- call `[addCoder:[MyCrazyCoder new]]`
- calling `coders` now returns `@[IOCoder, GIFCoder, APNGCoder, HEICCoder, MyCrazyCoder]`
- calling `coders` now returns `@[IOCoder, GIFCoder, APNGCoder, MyCrazyCoder]`
Coders
------

View File

@ -37,9 +37,6 @@
if (self = [super init]) {
// initialize with default coders
_imageCoders = [NSMutableArray arrayWithArray:@[[SDImageIOCoder sharedCoder], [SDImageGIFCoder sharedCoder], [SDImageAPNGCoder sharedCoder]]];
if (@available(iOS 11, macOS 10.14, tvOS 11, watchOS 4, *)) {
[_imageCoders addObject:[SDImageHEICCoder sharedCoder]];
}
_codersLock = dispatch_semaphore_create(1);
}
return self;

View File

@ -14,6 +14,7 @@
Image/IO provide the static HEIC (.heic) support in iOS 11/macOS 10.13/tvOS 11/watchOS 4+.
Image/IO provide the animated HEIC (.heics) support in iOS 13/macOS 10.15/tvOS 13/watchOS 6+.
See https://nokiatech.github.io/heif/technical.html for the standard.
@note This coder is not in the default coder list for now, since HEIC animated image is really rare, and Apple's implementation still contains performance issues. You can enable if you need this.
@note If you need to support lower firmware version for HEIF, you can have a try at https://github.com/SDWebImage/SDWebImageHEIFCoder
*/
@interface SDImageHEICCoder : SDImageIOAnimatedCoder <SDProgressiveImageCoder, SDAnimatedImageCoder>