From b271cbb371f4e98cc5de8ee9c310690bfee1ee65 Mon Sep 17 00:00:00 2001 From: Konstantinos K Date: Wed, 10 Dec 2014 14:42:43 +0200 Subject: [PATCH 1/3] initialise kPNGSignatureData data in SDImageCache initWithNamespace method. This ensures the kPNGSignatureData is always initialised even if the we alloc SDImageCache without using the sharedImageCache singleton --- SDWebImage/SDImageCache.m | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/SDWebImage/SDImageCache.m b/SDWebImage/SDImageCache.m index 36bb751a..dbc2d969 100644 --- a/SDWebImage/SDImageCache.m +++ b/SDWebImage/SDImageCache.m @@ -48,7 +48,6 @@ BOOL ImageDataHasPNGPreffix(NSData *data) { static id instance; dispatch_once(&once, ^{ instance = [self new]; - kPNGSignatureData = [NSData dataWithBytes:kPNGSignatureBytes length:8]; }); return instance; } @@ -61,6 +60,9 @@ BOOL ImageDataHasPNGPreffix(NSData *data) { if ((self = [super init])) { NSString *fullNamespace = [@"com.hackemist.SDWebImageCache." stringByAppendingString:ns]; + // initialise PNG signature data + kPNGSignatureData = [NSData dataWithBytes:kPNGSignatureBytes length:8]; + // Create IO serial queue _ioQueue = dispatch_queue_create("com.hackemist.SDWebImageCache", DISPATCH_QUEUE_SERIAL); From 0ae0e34642a0b43e1ae1984846e2bf11d21292ea Mon Sep 17 00:00:00 2001 From: Sam McDonald Date: Fri, 19 Dec 2014 10:14:08 -0800 Subject: [PATCH 2/3] Update README.md Picky spelling fix. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index df82aacb..65411360 100644 --- a/README.md +++ b/README.md @@ -193,7 +193,7 @@ Common Problems ### Using dynamic image size with UITableViewCell -UITableView determins the size of the image by the first image set for a cell. If your remote images +UITableView determines the size of the image by the first image set for a cell. If your remote images don't have the same size as your placeholder image, you may experience strange anamorphic scaling issue. The following article gives a way to workaround this issue: From cded20c736de2fcb7c801bdcb3c2626cb98772d3 Mon Sep 17 00:00:00 2001 From: Dick Date: Mon, 22 Dec 2014 16:58:16 +0800 Subject: [PATCH 3/3] duplicate failed urls are added into failedURLs fix bug when download image with option SDWebImageRetryFailed --- SDWebImage/SDWebImageManager.m | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/SDWebImage/SDWebImageManager.m b/SDWebImage/SDWebImageManager.m index 38f75f0c..0d2f31be 100644 --- a/SDWebImage/SDWebImageManager.m +++ b/SDWebImage/SDWebImageManager.m @@ -194,7 +194,9 @@ if (error.code != NSURLErrorNotConnectedToInternet && error.code != NSURLErrorCancelled && error.code != NSURLErrorTimedOut) { @synchronized (self.failedURLs) { - [self.failedURLs addObject:url]; + if (![self.failedURLs containsObject:url]) { + [self.failedURLs addObject:url]; + } } } }