forked from SDWebImage/SDWebImage
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove GIF specific code from main source, isolate it in a UIImage category to ease future addition of format support
- Loading branch information
Olivier Poitrey
committed
Jun 7, 2013
1 parent
447f1cc
commit 1dbb79f
Showing
8 changed files
with
113 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// | ||
// UIImage+MultiFormat.h | ||
// SDWebImage | ||
// | ||
// Created by Olivier Poitrey on 07/06/13. | ||
// Copyright (c) 2013 Dailymotion. All rights reserved. | ||
// | ||
|
||
#import <UIKit/UIKit.h> | ||
|
||
@interface UIImage (MultiFormat) | ||
|
||
+ (UIImage *)sd_imageWithData:(NSData *)data; | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// | ||
// UIImage+MultiFormat.m | ||
// SDWebImage | ||
// | ||
// Created by Olivier Poitrey on 07/06/13. | ||
// Copyright (c) 2013 Dailymotion. All rights reserved. | ||
// | ||
|
||
#import "UIImage+MultiFormat.h" | ||
#import "UIImage+GIF.h" | ||
|
||
@implementation UIImage (MultiFormat) | ||
|
||
+ (UIImage *)sd_imageWithData:(NSData *)data | ||
{ | ||
UIImage *image; | ||
|
||
if ([data sd_isGIF]) | ||
{ | ||
image = [UIImage sd_animatedGIFWithData:data]; | ||
} | ||
else | ||
{ | ||
image = [[UIImage alloc] initWithData:data]; | ||
} | ||
|
||
return image; | ||
} | ||
|
||
@end |