NSImage+WebCache.m 621 B

123456789101112131415161718192021222324252627282930313233
  1. /*
  2. * This file is part of the SDWebImage package.
  3. * (c) Olivier Poitrey <rs@dailymotion.com>
  4. *
  5. * For the full copyright and license information, please view the LICENSE
  6. * file that was distributed with this source code.
  7. */
  8. #import "NSImage+WebCache.h"
  9. #if SD_MAC
  10. @implementation NSImage (WebCache)
  11. - (CGImageRef)CGImage {
  12. NSRect imageRect = NSMakeRect(0, 0, self.size.width, self.size.height);
  13. CGImageRef cgImage = [self CGImageForProposedRect:&imageRect context:NULL hints:nil];
  14. return cgImage;
  15. }
  16. - (NSArray<NSImage *> *)images {
  17. return nil;
  18. }
  19. - (BOOL)isGIF {
  20. return NO;
  21. }
  22. @end
  23. #endif