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 Dailymotion paternity and move to joined paternity with Fraggl…
…e behind the Simple Design (SD) team name
- Loading branch information
Olivier Poitrey
committed
Sep 21, 2009
1 parent
8370d5d
commit a7734af
Showing
8 changed files
with
44 additions
and
44 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
Copyright (c) 2009 Dailymotion - Olivier Poitrey <[email protected]> | ||
Copyright (c) 2009 Olivier Poitrey <[email protected]> | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
|
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 |
---|---|---|
@@ -1,21 +1,21 @@ | ||
/* | ||
* This file is part of the DMWebImage package. | ||
* (c) Dailymotion - Olivier Poitrey <[email protected]> | ||
* This file is part of the SDWebImage package. | ||
* (c) Olivier Poitrey <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
@interface DMImageCache : NSObject | ||
@interface SDImageCache : NSObject | ||
{ | ||
NSMutableDictionary *memCache; | ||
NSString *diskCachePath; | ||
NSOperationQueue *cacheInQueue; | ||
} | ||
|
||
+ (DMImageCache *)sharedImageCache; | ||
+ (SDImageCache *)sharedImageCache; | ||
- (void)storeImage:(UIImage *)image forKey:(NSString *)key; | ||
- (void)storeImage:(UIImage *)image forKey:(NSString *)key toDisk:(BOOL)toDisk; | ||
- (UIImage *)imageFromKey:(NSString *)key; | ||
|
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 |
---|---|---|
@@ -1,19 +1,19 @@ | ||
/* | ||
* This file is part of the DMWebImage package. | ||
* (c) Dailymotion - Olivier Poitrey <[email protected]> | ||
* This file is part of the SDWebImage package. | ||
* (c) Olivier Poitrey <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
#import "DMImageCache.h" | ||
#import "SDImageCache.h" | ||
#import <CommonCrypto/CommonDigest.h> | ||
|
||
static NSInteger cacheMaxCacheAge = 60*60*24*7; // 1 week | ||
|
||
static DMImageCache *instance; | ||
static SDImageCache *instance; | ||
|
||
@implementation DMImageCache | ||
@implementation SDImageCache | ||
|
||
#pragma mark NSObject | ||
|
||
|
@@ -81,11 +81,11 @@ - (void)willTerminate | |
|
||
#pragma mark ImageCache (class methods) | ||
|
||
+ (DMImageCache *)sharedImageCache | ||
+ (SDImageCache *)sharedImageCache | ||
{ | ||
if (instance == nil) | ||
{ | ||
instance = [[DMImageCache alloc] init]; | ||
instance = [[SDImageCache alloc] init]; | ||
} | ||
|
||
return instance; | ||
|
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 |
---|---|---|
@@ -1,14 +1,14 @@ | ||
/* | ||
* This file is part of the DMWebImage package. | ||
* (c) Dailymotion - Olivier Poitrey <[email protected]> | ||
* This file is part of the SDWebImage package. | ||
* (c) Olivier Poitrey <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
@interface DMWebImageDownloader : NSOperation | ||
@interface SDWebImageDownloader : NSOperation | ||
{ | ||
NSURL *url; | ||
id target; | ||
|
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 |
---|---|---|
@@ -1,16 +1,16 @@ | ||
/* | ||
* This file is part of the DMWebImage package. | ||
* (c) Dailymotion - Olivier Poitrey <[email protected]> | ||
* This file is part of the SDWebImage package. | ||
* (c) Olivier Poitrey <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
#import "DMWebImageDownloader.h" | ||
#import "SDWebImageDownloader.h" | ||
|
||
static NSOperationQueue *downloadQueue; | ||
|
||
@implementation DMWebImageDownloader | ||
@implementation SDWebImageDownloader | ||
|
||
@synthesize url, target, action; | ||
|
||
|
@@ -22,7 +22,7 @@ - (void)dealloc | |
|
||
+ (id)downloaderWithURL:(NSURL *)url target:(id)target action:(SEL)action | ||
{ | ||
DMWebImageDownloader *downloader = [[[DMWebImageDownloader alloc] init] autorelease]; | ||
SDWebImageDownloader *downloader = [[[SDWebImageDownloader alloc] init] autorelease]; | ||
downloader.url = url; | ||
downloader.target = target; | ||
downloader.action = action; | ||
|
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 |
---|---|---|
@@ -1,19 +1,19 @@ | ||
/* | ||
* This file is part of the DMWebImage package. | ||
* (c) Dailymotion - Olivier Poitrey <[email protected]> | ||
* This file is part of the SDWebImage package. | ||
* (c) Olivier Poitrey <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
#import <UIKit/UIKit.h> | ||
|
||
@class DMWebImageDownloader; | ||
@class SDWebImageDownloader; | ||
|
||
@interface DMWebImageView : UIImageView | ||
@interface SDWebImageView : UIImageView | ||
{ | ||
UIImage *placeHolderImage; | ||
DMWebImageDownloader *downloader; | ||
SDWebImageDownloader *downloader; | ||
} | ||
|
||
- (void)setImageWithURL:(NSURL *)url; | ||
|
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 |
---|---|---|
@@ -1,16 +1,16 @@ | ||
/* | ||
* This file is part of the DMWebImage package. | ||
* (c) Dailymotion - Olivier Poitrey <[email protected]> | ||
* This file is part of the SDWebImage package. | ||
* (c) Olivier Poitrey <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
#import "DMWebImageView.h" | ||
#import "DMImageCache.h" | ||
#import "DMWebImageDownloader.h" | ||
#import "SDWebImageView.h" | ||
#import "SDImageCache.h" | ||
#import "SDWebImageDownloader.h" | ||
|
||
@implementation DMWebImageView | ||
@implementation SDWebImageView | ||
|
||
- (void)dealloc | ||
{ | ||
|
@@ -41,15 +41,15 @@ - (void)setImageWithURL:(NSURL *)url | |
self.image = placeHolderImage; | ||
} | ||
|
||
UIImage *cachedImage = [[DMImageCache sharedImageCache] imageFromKey:[url absoluteString]]; | ||
UIImage *cachedImage = [[SDImageCache sharedImageCache] imageFromKey:[url absoluteString]]; | ||
|
||
if (cachedImage) | ||
{ | ||
self.image = cachedImage; | ||
} | ||
else | ||
{ | ||
downloader = [[DMWebImageDownloader downloaderWithURL:url target:self action:@selector(downloadFinishedWithImage:)] retain]; | ||
downloader = [[SDWebImageDownloader downloaderWithURL:url target:self action:@selector(downloadFinishedWithImage:)] retain]; | ||
} | ||
} | ||
|
||
|
@@ -59,7 +59,7 @@ - (void)downloadFinishedWithImage:(UIImage *)anImage | |
self.image = anImage; | ||
|
||
// Store the image in the cache | ||
[[DMImageCache sharedImageCache] storeImage:anImage forKey:[downloader.url absoluteString]]; | ||
[[SDImageCache sharedImageCache] storeImage:anImage forKey:[downloader.url absoluteString]]; | ||
|
||
// Free the downloader | ||
[downloader release]; | ||
|