Merge pull request #10 from SDWebImage/bugfix_revert_static_cgimage_check

Remove unnecessary CGImage check when encode first frame because UIAn…
This commit is contained in:
DreamPiggy 2019-02-02 11:35:03 +08:00 committed by GitHub
commit 74c94cb5e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 7 deletions

View File

@ -464,13 +464,7 @@
BOOL encodeFirstFrame = [options[SDImageCoderEncodeFirstFrameOnly] boolValue];
if (encodeFirstFrame || frames.count == 0) {
// for static single webp image
CGImageRef imageRef = image.CGImage;
#if SD_UIKIT || SD_WATCH
if (!imageRef) {
imageRef = image.images.firstObject.CGImage;
}
#endif
data = [self sd_encodedWebpDataWithImage:imageRef quality:compressionQuality];
data = [self sd_encodedWebpDataWithImage:image.CGImage quality:compressionQuality];
} else {
// for animated webp image
WebPMux *mux = WebPMuxNew();