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: 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); 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]; + } } } }