UIImage+GIF.m 598 B

123456789101112131415161718192021222324252627
  1. /*
  2. * This file is part of the SDWebImage package.
  3. * (c) Olivier Poitrey <rs@dailymotion.com>
  4. * (c) Laurin Brandner
  5. *
  6. * For the full copyright and license information, please view the LICENSE
  7. * file that was distributed with this source code.
  8. */
  9. #import "UIImage+GIF.h"
  10. #import "SDWebImageGIFCoder.h"
  11. #import "NSImage+WebCache.h"
  12. @implementation UIImage (GIF)
  13. + (UIImage *)sd_animatedGIFWithData:(NSData *)data {
  14. if (!data) {
  15. return nil;
  16. }
  17. return [[SDWebImageGIFCoder sharedCoder] decodedImageWithData:data];
  18. }
  19. - (BOOL)isGIF {
  20. return (self.images != nil);
  21. }
  22. @end