diff --git a/SDWebImage/SDWebImageGIFCoder.m b/SDWebImage/SDWebImageGIFCoder.m index 72162148..e4f55b1b 100644 --- a/SDWebImage/SDWebImageGIFCoder.m +++ b/SDWebImage/SDWebImageGIFCoder.m @@ -160,6 +160,9 @@ return nil; } +#ifdef SD_MAC + CGImageDestinationAddImage(imageDestination, image.CGImage, nil); +#else if (!image.images) { // for static single GIF images CGImageDestinationAddImage(imageDestination, image.CGImage, nil); @@ -178,6 +181,7 @@ } } } +#endif // Finalize the destination. if (CGImageDestinationFinalize(imageDestination) == NO) { diff --git a/SDWebImage/SDWebImageImageIOCoder.m b/SDWebImage/SDWebImageImageIOCoder.m index e51aabd4..149eaa18 100644 --- a/SDWebImage/SDWebImageImageIOCoder.m +++ b/SDWebImage/SDWebImageImageIOCoder.m @@ -89,6 +89,10 @@ static const CGFloat kDestSeemOverlap = 2.0f; // the numbers of pixels to over return nil; } +#if SD_MAC + return [[UIImage alloc] initWithData:data]; +#else + UIImage *image = [[UIImage alloc] initWithData:data]; if (!image) { return nil; @@ -111,6 +115,7 @@ static const CGFloat kDestSeemOverlap = 2.0f; // the numbers of pixels to over #endif return image; +#endif } - (UIImage *)incrementallyDecodedImageWithData:(NSData *)data finished:(BOOL)finished {