diff --git a/.github/stale.yml b/.github/stale.yml new file mode 100644 index 00000000..3b3b587f --- /dev/null +++ b/.github/stale.yml @@ -0,0 +1,28 @@ +# Number of days of inactivity before an issue becomes stale +daysUntilStale: 30 +# Number of days of inactivity before a stale issue is closed +daysUntilClose: 7 +# Issues with these labels will never be considered stale +exemptLabels: + - important +# Label to use when marking an issue as stale +staleLabel: stale +# Comment to post when marking an issue as stale. Set to `false` to disable +markComment: > + This issue has been automatically marked as stale because it has not had + recent activity. It will be closed if no further activity occurs. + If this is still an issue, please make sure it is up to date and if so, + add a comment that this is still an issue to keep it open. + Thank you for your contributions. +# Comment to post when closing a stale issue. Set to `false` to disable +closeComment: false + +# Optionally, specify configuration settings that are specific to just 'issues' or 'pulls': +pulls: + daysUntilStale: 60 + markComment: > + This pull request has been automatically marked as stale because it has not had + recent activity. It will be closed if no further activity occurs. + If this is still applicable, please make sure it is up to date and if so, + add a comment that this is still an issue to keep it open. + Thank you for your contributions. diff --git a/CHANGELOG.md b/CHANGELOG.md index 0dab3171..523ec928 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,8 +36,27 @@ See [all tickets marked for the 5.0.0 release](https://github.com/rs/SDWebImage/ - Rename `sd_UTTypeFromSDImageFormat` to `sd_UTTypeFromImageFormat` #2395 - Change `SDImageFormat` to use `NS_TYPED_EXTENSIBLE_ENUM` instead of fixed enum, to allow custom coder plugins to extend it #2400 -## [4.4.2 - 4.4 patch, on July 18th, 2018](https://github.com/rs/SDWebImage/releases/tag/4.4.2) -See [all tickets marked for the 4.4.2 release](https://github.com/rs/SDWebImage/milestone/27) +## [4.4.3 - 4.4 patch, on Nov 12th, 2018](https://github.com/SDWebImage/SDWebImage/releases/tag/4.4.3) +See [all tickets marked for the 4.4.3 release](https://github.com/SDWebImage/SDWebImage/milestone/28) + +#### Fixes +- Revert the hack code for `FLAnimatedImage`, because of the `FLAnimatedImage` initializer method blocks the main queue #2441 +- Optimize when scale = 1 #2520 +- Fix extention long length of file name #2516 6c6d848 +- Add autoreleasepool to release autorelease objects in advance when using GCD for 4.x #2475 +- Fix resource key invalid when clean cached disk file #2463 +- Fix the test case `testFLAnimatedImageViewSetImageWithURL` because of remote resource is not available #2450 +- Add default `HTTP User-Agent` for specific system #2409 +- Add `SDImageFormatHEIF` represent `mif1` && `msf1` brands #2423 +- remove `addProgressCallback`, add `createDownloaderOperationWithUrl` #2336 +- Fix the bug when `FLAnimatedImageView` firstly show one EXIF rotation JPEG `UIImage`, later animated GIF `FLAnimatedImage` will also be rotated #2406 +- Replace `SDWebImageDownloaderOperation` with `NSOperation` to make generic #2397 +- Updated URLs after project was transfered to [SDWebImage organization](https://github.com/SDWebImage) #2510 f9d05d9 +- Tidy up spacing for `README.md` #2511 +- Remove versioneye from README #2424 + +## [4.4.2 - 4.4 patch, on July 18th, 2018](https://github.com/SDWebImage/SDWebImage/releases/tag/4.4.2) +See [all tickets marked for the 4.4.2 release](https://github.com/SDWebImage/SDWebImage/milestone/27) #### Features - Ability to change the clear cache option `SDImageCacheConfig.diskCacheExpireType` #2357 @@ -104,8 +123,8 @@ See the [5.0 Migration Guide](https://raw.githubusercontent.com/rs/SDWebImage/5. #### Fixes - `SDWebImageManager loadImageWithURL:options:progress:completed:` changed the `completed` param requirement from `nullable` to `nonnull` #2164 -## [4.4.1 - 4.4 patch, on June 7th, 2018](https://github.com/rs/SDWebImage/releases/tag/4.4.1) -See [all tickets marked for the 4.4.1 release](https://github.com/rs/SDWebImage/milestone/26) +## [4.4.1 - 4.4 patch, on June 7th, 2018](https://github.com/SDWebImage/SDWebImage/releases/tag/4.4.1) +See [all tickets marked for the 4.4.1 release](https://github.com/SDWebImage/SDWebImage/milestone/26) #### Fixes - Coder @@ -113,8 +132,8 @@ See [all tickets marked for the 4.4.1 release](https://github.com/rs/SDWebImage/ - Downloader - Fix that the downloader operation may not call the completion block when requesting the same image url in race condition #2346 #2344 -## [4.4.0 - watchOS View Category, on May 31st, 2018](https://github.com/rs/SDWebImage/releases/tag/4.4.0) -See [all tickets marked for the 4.4.0 release](https://github.com/rs/SDWebImage/milestone/25) +## [4.4.0 - watchOS View Category, on May 31st, 2018](https://github.com/SDWebImage/SDWebImage/releases/tag/4.4.0) +See [all tickets marked for the 4.4.0 release](https://github.com/SDWebImage/SDWebImage/milestone/25) #### Features - View Category @@ -146,8 +165,8 @@ See [all tickets marked for the 4.4.0 release](https://github.com/rs/SDWebImage/ #### Docs - Fix function storeImageDataToDisk description #2301 -## [4.3.3 - Cache Serializer, on Mar 12th, 2018](https://github.com/rs/SDWebImage/releases/tag/4.3.3) -See [all tickets marked for the 4.3.3 release](https://github.com/rs/SDWebImage/milestone/24) +## [4.3.3 - Cache Serializer, on Mar 12th, 2018](https://github.com/SDWebImage/SDWebImage/releases/tag/4.3.3) +See [all tickets marked for the 4.3.3 release](https://github.com/SDWebImage/SDWebImage/milestone/24) #### Features - Manager @@ -159,8 +178,8 @@ See [all tickets marked for the 4.3.3 release](https://github.com/rs/SDWebImage/ - Enable CLANG\_WARN\_OBJC\_IMPLICIT\_RETAIN\_SELF and fix warning #2242 -## [4.3.2 - 4.3 Patch, on Feb 28th, 2018](https://github.com/rs/SDWebImage/releases/tag/4.3.2) -See [all tickets marked for the 4.3.2 release](https://github.com/rs/SDWebImage/milestone/23) +## [4.3.2 - 4.3 Patch, on Feb 28th, 2018](https://github.com/SDWebImage/SDWebImage/releases/tag/4.3.2) +See [all tickets marked for the 4.3.2 release](https://github.com/SDWebImage/SDWebImage/milestone/23) #### Fixes - Download Operation @@ -170,8 +189,8 @@ See [all tickets marked for the 4.3.2 release](https://github.com/rs/SDWebImage/ - Downloader - Follow Apple's doc, add NSOperation only after all configuration done #2232 -## [4.3.1 - 4.3 Patch, on Feb 25th, 2018](https://github.com/rs/SDWebImage/releases/tag/4.3.1) -See [all tickets marked for the 4.3.1 release](https://github.com/rs/SDWebImage/milestone/22) +## [4.3.1 - 4.3 Patch, on Feb 25th, 2018](https://github.com/SDWebImage/SDWebImage/releases/tag/4.3.1) +See [all tickets marked for the 4.3.1 release](https://github.com/SDWebImage/SDWebImage/milestone/22) #### Fixes - Cache @@ -196,8 +215,8 @@ See [all tickets marked for the 4.3.1 release](https://github.com/rs/SDWebImage/ - Fix CLANG\_WARN\_OBJC\_IMPLICIT\_RETAIN\_SELF warning #2225 -## [4.3.0 - Image Progress & Transition, on Jan 31th, 2018](https://github.com/rs/SDWebImage/releases/tag/4.3.0) -See [all tickets marked for the 4.3.0 release](https://github.com/rs/SDWebImage/milestone/21) +## [4.3.0 - Image Progress & Transition, on Jan 31th, 2018](https://github.com/SDWebImage/SDWebImage/releases/tag/4.3.0) +See [all tickets marked for the 4.3.0 release](https://github.com/SDWebImage/SDWebImage/milestone/21) #### Features - View Category @@ -241,8 +260,8 @@ See [all tickets marked for the 4.3.0 release](https://github.com/rs/SDWebImage/ - Project - Update the spec file to define the dependency version for libwebp #2169 -## [4.2.3 - 4.2 Patch, on Nov 30th, 2017](https://github.com/rs/SDWebImage/releases/tag/4.2.3) -See [all tickets marked for the 4.2.3 release](https://github.com/rs/SDWebImage/milestone/20) +## [4.2.3 - 4.2 Patch, on Nov 30th, 2017](https://github.com/SDWebImage/SDWebImage/releases/tag/4.2.3) +See [all tickets marked for the 4.2.3 release](https://github.com/SDWebImage/SDWebImage/milestone/20) #### Features - Add a public API to allow user to invalidate URLSession used in SDWebImageDownloader to avoid memory leak on non-singleton instance #2116 @@ -260,8 +279,8 @@ See [all tickets marked for the 4.2.3 release](https://github.com/rs/SDWebImage/ - Adopt the current requirement, change ImageIO coder's canDecodeFromHEIC to actual implementation #2146 #2138 - When store image with no data for SDImageCache, check whether it contains alpha to use PNG or JPEG format #2136 -## [4.2.2 - 4.2 Patch, on Nov 7th, 2017](https://github.com/rs/SDWebImage/releases/tag/4.2.2) -See [all tickets marked for the 4.2.2 release](https://github.com/rs/SDWebImage/milestone/19) +## [4.2.2 - 4.2 Patch, on Nov 7th, 2017](https://github.com/SDWebImage/SDWebImage/releases/tag/4.2.2) +See [all tickets marked for the 4.2.2 release](https://github.com/SDWebImage/SDWebImage/milestone/19) #### Features - Update our iOS demo to modern way, add a `UIProgressView` to show image download progress #2096 @@ -270,8 +289,8 @@ See [all tickets marked for the 4.2.2 release](https://github.com/rs/SDWebImage/ - Fix that completion block and set image block are called asynchronously for `UIView+WebCache` #2093 #2097 #2092 - Fix WebP progressive decoding may do extra calculate #2095 -## [4.2.1 - 4.2 Patch, on Oct 31st, 2017](https://github.com/rs/SDWebImage/releases/tag/4.2.1) -See [all tickets marked for the 4.2.1 release](https://github.com/rs/SDWebImage/milestone/18) +## [4.2.1 - 4.2 Patch, on Oct 31st, 2017](https://github.com/SDWebImage/SDWebImage/releases/tag/4.2.1) +See [all tickets marked for the 4.2.1 release](https://github.com/SDWebImage/SDWebImage/milestone/18) #### Features - Feature refactor built-in coders and support animated webp on macOS #2082 (reusable code into `SDWebImageCoderHelper`; `SDWebImageFrame` abstracts animated images frames) @@ -279,8 +298,8 @@ See [all tickets marked for the 4.2.1 release](https://github.com/rs/SDWebImage/ #### Fixes - Fixed EXIF orientation method will crash on iOS 7 because it’s an iOS 8 above API #2082 -## [4.2.0 - Pluginable coders, on Oct 30th, 2017](https://github.com/rs/SDWebImage/releases/tag/4.2.0) -See [all tickets marked for the 4.2.0 release](https://github.com/rs/SDWebImage/milestone/16) +## [4.2.0 - Pluginable coders, on Oct 30th, 2017](https://github.com/SDWebImage/SDWebImage/releases/tag/4.2.0) +See [all tickets marked for the 4.2.0 release](https://github.com/SDWebImage/SDWebImage/milestone/16) #### Features - Refactor decoding code and provide decoding plugin #1991 @@ -304,8 +323,8 @@ See [all tickets marked for the 4.2.0 release](https://github.com/rs/SDWebImage/ #### Docs - Updated diagrams -## [4.1.2 - 4.1 patch, on Oct 9th, 2017](https://github.com/rs/SDWebImage/releases/tag/4.1.2) -See [all tickets marked for the 4.1.2 release](https://github.com/rs/SDWebImage/milestone/17) +## [4.1.2 - 4.1 patch, on Oct 9th, 2017](https://github.com/SDWebImage/SDWebImage/releases/tag/4.1.2) +See [all tickets marked for the 4.1.2 release](https://github.com/SDWebImage/SDWebImage/milestone/17) #### Fixes @@ -313,8 +332,8 @@ See [all tickets marked for the 4.1.2 release](https://github.com/rs/SDWebImage/ - Static `WebP` decoding little enhancement. Do not need create `WebP` iterator for static images #2050 - Change `finished` check from `equal` to `equal or greater than` to protect accident condition #2051 -## [4.1.1 - 4.1 patch, on Oct 6th, 2017](https://github.com/rs/SDWebImage/releases/tag/4.1.1) -See [all tickets marked for the 4.1.1 release](https://github.com/rs/SDWebImage/milestone/14) +## [4.1.1 - 4.1 patch, on Oct 6th, 2017](https://github.com/SDWebImage/SDWebImage/releases/tag/4.1.1) +See [all tickets marked for the 4.1.1 release](https://github.com/SDWebImage/SDWebImage/milestone/14) #### Fixes @@ -341,8 +360,8 @@ See [all tickets marked for the 4.1.1 release](https://github.com/rs/SDWebImage/ - Updated *Manual Installation* section #2030 fixes #2012 -## [4.1.0 - Swift API cleanup, on Jul 31st, 2017](https://github.com/rs/SDWebImage/releases/tag/4.1.0) -See [all tickets marked for the 4.1.0 release](https://github.com/rs/SDWebImage/milestone/13) +## [4.1.0 - Swift API cleanup, on Jul 31st, 2017](https://github.com/SDWebImage/SDWebImage/releases/tag/4.1.0) +See [all tickets marked for the 4.1.0 release](https://github.com/SDWebImage/SDWebImage/milestone/13) #### Features @@ -371,14 +390,14 @@ See [all tickets marked for the 4.1.0 release](https://github.com/rs/SDWebImage/ - #1778 #1779 #1788 #1799 b1c3bb7 (replaces #1806) 0df32ea #1847 5eb83c3 (replaces #1828) #1946 #1966 -## [4.0.0 - New platforms (Mac OS X and watchOS) + refactoring, on Jan 28th, 2017](https://github.com/rs/SDWebImage/releases/tag/4.0.0) +## [4.0.0 - New platforms (Mac OS X and watchOS) + refactoring, on Jan 28th, 2017](https://github.com/SDWebImage/SDWebImage/releases/tag/4.0.0) -See [all tickets marked for the 4.0.0 release](https://github.com/rs/SDWebImage/milestone/3) +See [all tickets marked for the 4.0.0 release](https://github.com/SDWebImage/SDWebImage/milestone/3) Versions 4.0.0-beta and 4.0.0-beta 2 list all the changes. -## [4.0.0 beta 2 - New platforms (Mac OS X and watchOS) + refactoring, on Oct 6th, 2016](https://github.com/rs/SDWebImage/releases/tag/4.0.0-beta2) +## [4.0.0 beta 2 - New platforms (Mac OS X and watchOS) + refactoring, on Oct 6th, 2016](https://github.com/SDWebImage/SDWebImage/releases/tag/4.0.0-beta2) -See [all tickets marked for the 4.0.0 release](https://github.com/rs/SDWebImage/milestone/3) +See [all tickets marked for the 4.0.0 release](https://github.com/SDWebImage/SDWebImage/milestone/3) #### Features @@ -388,9 +407,9 @@ See [all tickets marked for the 4.0.0 release](https://github.com/rs/SDWebImage/ - Fixed #1668 CGContextDrawImage: invalid context 0x0 - b366d84 -## [4.0.0 beta - New platforms (Mac OS X and watchOS) + refactoring, on Oct 5th, 2016](https://github.com/rs/SDWebImage/releases/tag/4.0.0-beta) +## [4.0.0 beta - New platforms (Mac OS X and watchOS) + refactoring, on Oct 5th, 2016](https://github.com/SDWebImage/SDWebImage/releases/tag/4.0.0-beta) -See [all tickets marked for the 4.0.0 release](https://github.com/rs/SDWebImage/milestone/3) +See [all tickets marked for the 4.0.0 release](https://github.com/SDWebImage/SDWebImage/milestone/3) #### Infrastructure: @@ -408,7 +427,7 @@ See [all tickets marked for the 4.0.0 release](https://github.com/rs/SDWebImage/ - `SDWebImage TV Demo` - `SDWebImage Watch Demo` - bumped `libwep` version to `0.5.1` -- improved unit testing code coverage (*35%* -> **77%**) and integrated [CodeCov](https://codecov.io/gh/rs/SDWebImage) +- improved unit testing code coverage (*35%* -> **77%**) and integrated [CodeCov](https://codecov.io/gh/SDWebImage/SDWebImage) #### Backwards incompatible changes @@ -490,20 +509,20 @@ See [all tickets marked for the 4.0.0 release](https://github.com/rs/SDWebImage/ - Fixed #1089 by updating the docs on the calling queue for the `progressBlock` (background queue) - Fixed a compilation issue on `FLAnimatedImageView+WebCache` - #1687 -## [3.8.2 Patch release for 3.8.0 on Sep 5th, 2016](https://github.com/rs/SDWebImage/releases/tag/3.8.2) +## [3.8.2 Patch release for 3.8.0 on Sep 5th, 2016](https://github.com/SDWebImage/SDWebImage/releases/tag/3.8.2) #### Fixes: - Fixed #1608 #1623 #1644 Crash in `[NSURLCache cachedResponseForRequest:]` - the fix is actually avoiding to access `NSURLCache` which appears to generate a race condition. We only call it if necesarry (`SDWebImageRefreshCached` is used and the image cannot be cached by the system when it's too big or behind authentication) -## [3.8.1 Patch release for 3.8.0 on Jun 7th, 2016](https://github.com/rs/SDWebImage/releases/tag/3.8.1) +## [3.8.1 Patch release for 3.8.0 on Jun 7th, 2016](https://github.com/SDWebImage/SDWebImage/releases/tag/3.8.1) #### Fixes: - SDWebImage 3.8.0 get wrong image #1589 - the issue was caused by the changes in 3.8.0 (Removed the URL query params from the filename (key) fb0cdb6d 1bf62d4 #1584 - fixes #1433 #1553 #1583 #1585) - Reverted. - Note: The solution for those issues (i.e. #1433 #1553) is to set the `SDWebImageManager` `cacheKeyFilter` block and do their own calculations there. -## [3.8.0 Minor release - Replaces NSURLConnection (deprecated) with NSURLSession - on Jun 6th, 2016](https://github.com/rs/SDWebImage/releases/tag/3.8.0) +## [3.8.0 Minor release - Replaces NSURLConnection (deprecated) with NSURLSession - on Jun 6th, 2016](https://github.com/SDWebImage/SDWebImage/releases/tag/3.8.0) #### Infrastructure: @@ -520,7 +539,7 @@ See [all tickets marked for the 4.0.0 release](https://github.com/rs/SDWebImage/ - Fixed the WebP build with the official 1.0.0 CocoaPods release f1a471e - fixes #1444 - Updated doc: `removeImageForKey:` not synchronous e6e5c51 - fixes #1379 #1415 -## [3.7.6 Patch release for 3.7.0 on May 8th, 2016](https://github.com/rs/SDWebImage/releases/tag/3.7.6) +## [3.7.6 Patch release for 3.7.0 on May 8th, 2016](https://github.com/SDWebImage/SDWebImage/releases/tag/3.7.6) #### Infrastructure: - Changed the **libwebp git url** so that people from China can access it - #1390 (from `https://chromium.googlesource.com/webm/libwebp` to `https://github.com/webmproject/libwebp`) @@ -540,11 +559,11 @@ See [all tickets marked for the 4.0.0 release](https://github.com/rs/SDWebImage/ - Protect against malformed frame for GIFs - #1447 - updated doc: #1462 #1466 #1486 #1532 #1461 -## [3.7.5 Patch release for 3.7.0 on Jan 21st, 2016](https://github.com/rs/SDWebImage/releases/tag/3.7.5) +## [3.7.5 Patch release for 3.7.0 on Jan 21st, 2016](https://github.com/SDWebImage/SDWebImage/releases/tag/3.7.5) - fixed #1425 and #1426 - Continuation of Fix #1366, addresses #1350 and reverts a part of #1221 - from commit 6406d8e, the wrong usage of `dispatch_apply` - fixed #1422 - Added a fallback for #976 so that if there are images saved with the old format (no extension), they can still be loaded -## [3.7.4 Patch release for 3.7.0 with tvOS support on Jan 8th, 2016](https://github.com/rs/SDWebImage/releases/tag/3.7.4) +## [3.7.4 Patch release for 3.7.0 with tvOS support on Jan 8th, 2016](https://github.com/SDWebImage/SDWebImage/releases/tag/3.7.4) #### Updates - bumped `libwep` version to `0.4.4` @@ -581,134 +600,134 @@ See [all tickets marked for the 4.0.0 release](https://github.com/rs/SDWebImage/ - Remove logging from the image prefetcher - #1276 - Fix typos #1256 #1257 #1258 #1331 #1290 -## [3.7.3 Patch release for 3.7.0 with iOS8+ framework and Carthage on Jun 13th, 2015](https://github.com/rs/SDWebImage/releases/tag/3.7.3) +## [3.7.3 Patch release for 3.7.0 with iOS8+ framework and Carthage on Jun 13th, 2015](https://github.com/SDWebImage/SDWebImage/releases/tag/3.7.3) -- Adds support for **iOS 8+ Framework and Carthage** [#1071](https://github.com/rs/SDWebImage/pull/1071) [#1081](https://github.com/rs/SDWebImage/pull/1081) [#1101](https://github.com/rs/SDWebImage/pull/1101) +- Adds support for **iOS 8+ Framework and Carthage** [#1071](https://github.com/SDWebImage/SDWebImage/pull/1071) [#1081](https://github.com/SDWebImage/SDWebImage/pull/1081) [#1101](https://github.com/SDWebImage/SDWebImage/pull/1101) -- [Refactor] Use `NSMutableSet` for failed URLs' storage instead of array [#1076](https://github.com/rs/SDWebImage/pull/1076) -- Make a constant for the error domain [#1011](https://github.com/rs/SDWebImage/pull/1011) -- Improve operation behavior [#988](https://github.com/rs/SDWebImage/pull/988) -- Bug fix: `Collection <__NSArrayM: > was mutated while being enumerated` [#985](https://github.com/rs/SDWebImage/pull/985) -- added `SDWebImageAvoidAutoSetImage` option to avoid automatic image addition in `UIImageView` and let developer to do it himself [#1188](https://github.com/rs/SDWebImage/pull/1188) -- Added support for custom disk cache folder with fall back for caches directory [#1153](https://github.com/rs/SDWebImage/pull/1153) -- Added some files to the workspace so they are easier to edit [8431481](https://github.com/rs/SDWebImage/commit/8431481) -- Doc update [72ed897](https://github.com/rs/SDWebImage/commit/72ed897) [7f99c01](https://github.com/rs/SDWebImage/commit/7f99c01) [#1016](https://github.com/rs/SDWebImage/pull/1016) [#1038](https://github.com/rs/SDWebImage/pull/1038) [#1045](https://github.com/rs/SDWebImage/pull/1045) -- [Memory Issue] Clear `SDWebImagePrefetcher` `progressBlock` when it has completed [#1017](https://github.com/rs/SDWebImage/pull/1017) -- avoid warning `: ImageIO: CGImageSourceCreateWithData data parameter is nil` if `imageData` is nil [88ee3c6](https://github.com/rs/SDWebImage/commit/88ee3c6) [#1018](https://github.com/rs/SDWebImage/pull/1018) -- allow override `diskCachePath` [#1041](https://github.com/rs/SDWebImage/pull/1041) -- Use `__typeof(self)` when assigning `weak` reference for block [#1054](https://github.com/rs/SDWebImage/pull/1054) -- [Refactor] Implement cache cost calculation as a inline function [#1075](https://github.com/rs/SDWebImage/pull/1075) -- @3x support [9620fff](https://github.com/rs/SDWebImage/commit/9620fff) [#1005](https://github.com/rs/SDWebImage/pull/1005) -- Fix parenthesis to avoid crashes [#1104](https://github.com/rs/SDWebImage/pull/1104) -- Add `NSCache` countLimit property [#1140](https://github.com/rs/SDWebImage/pull/1140) -- `failedURLs` can be removed at the appropriate time [#1111](https://github.com/rs/SDWebImage/pull/1111) -- Purge `NSCache` on system memory notifications [#1143](https://github.com/rs/SDWebImage/pull/1143) -- Determines at runtime is `UIApplication` is available as per [#1082](https://github.com/rs/SDWebImage/issues/1082) [#1085](https://github.com/rs/SDWebImage/pull/1085) -- Fixes http://git.chromium.org/webm/libwebp.git/info/refs not valid [#1175](https://github.com/rs/SDWebImage/pull/1175) + Reverted [#1193](https://github.com/rs/SDWebImage/pull/1193) + [#1177](https://github.com/rs/SDWebImage/pull/1177) -- 404 image url was causing the test to fail [0e761f4](https://github.com/rs/SDWebImage/commit/0e761f4) -- Fix for transparency being lost in transformed images. [#1121](https://github.com/rs/SDWebImage/pull/1121) -- Add handling for additional error codes that shouldn't be considered a permanent failure [#1159](https://github.com/rs/SDWebImage/pull/1159) -- add webp accepted content type only if `WebP` enabled [#1178](https://github.com/rs/SDWebImage/pull/1178) -- fix `ImageIO: CGImageSourceCreateWithData` data parameter is nil [#1167](https://github.com/rs/SDWebImage/pull/1167) -- Applied patch for issue [#1074](https://github.com/rs/SDWebImage/issues/1074) SDWebImage residing in swift module breaks the debugger [#1138](https://github.com/rs/SDWebImage/pull/1138) -- Fixed URLs with trailing parameters get assigned an incorrect image scale value [#1157](https://github.com/rs/SDWebImage/issues/1157) [#1158](https://github.com/rs/SDWebImage/pull/1158) -- Add newline to avoid compiler warning in `WebImage.h` [#1199](https://github.com/rs/SDWebImage/pull/1199) +- [Refactor] Use `NSMutableSet` for failed URLs' storage instead of array [#1076](https://github.com/SDWebImage/SDWebImage/pull/1076) +- Make a constant for the error domain [#1011](https://github.com/SDWebImage/SDWebImage/pull/1011) +- Improve operation behavior [#988](https://github.com/SDWebImage/SDWebImage/pull/988) +- Bug fix: `Collection <__NSArrayM: > was mutated while being enumerated` [#985](https://github.com/SDWebImage/SDWebImage/pull/985) +- added `SDWebImageAvoidAutoSetImage` option to avoid automatic image addition in `UIImageView` and let developer to do it himself [#1188](https://github.com/SDWebImage/SDWebImage/pull/1188) +- Added support for custom disk cache folder with fall back for caches directory [#1153](https://github.com/SDWebImage/SDWebImage/pull/1153) +- Added some files to the workspace so they are easier to edit [8431481](https://github.com/SDWebImage/SDWebImage/commit/8431481) +- Doc update [72ed897](https://github.com/SDWebImage/SDWebImage/commit/72ed897) [7f99c01](https://github.com/SDWebImage/SDWebImage/commit/7f99c01) [#1016](https://github.com/SDWebImage/SDWebImage/pull/1016) [#1038](https://github.com/SDWebImage/SDWebImage/pull/1038) [#1045](https://github.com/SDWebImage/SDWebImage/pull/1045) +- [Memory Issue] Clear `SDWebImagePrefetcher` `progressBlock` when it has completed [#1017](https://github.com/SDWebImage/SDWebImage/pull/1017) +- avoid warning `: ImageIO: CGImageSourceCreateWithData data parameter is nil` if `imageData` is nil [88ee3c6](https://github.com/SDWebImage/SDWebImage/commit/88ee3c6) [#1018](https://github.com/SDWebImage/SDWebImage/pull/1018) +- allow override `diskCachePath` [#1041](https://github.com/SDWebImage/SDWebImage/pull/1041) +- Use `__typeof(self)` when assigning `weak` reference for block [#1054](https://github.com/SDWebImage/SDWebImage/pull/1054) +- [Refactor] Implement cache cost calculation as a inline function [#1075](https://github.com/SDWebImage/SDWebImage/pull/1075) +- @3x support [9620fff](https://github.com/SDWebImage/SDWebImage/commit/9620fff) [#1005](https://github.com/SDWebImage/SDWebImage/pull/1005) +- Fix parenthesis to avoid crashes [#1104](https://github.com/SDWebImage/SDWebImage/pull/1104) +- Add `NSCache` countLimit property [#1140](https://github.com/SDWebImage/SDWebImage/pull/1140) +- `failedURLs` can be removed at the appropriate time [#1111](https://github.com/SDWebImage/SDWebImage/pull/1111) +- Purge `NSCache` on system memory notifications [#1143](https://github.com/SDWebImage/SDWebImage/pull/1143) +- Determines at runtime is `UIApplication` is available as per [#1082](https://github.com/SDWebImage/SDWebImage/issues/1082) [#1085](https://github.com/SDWebImage/SDWebImage/pull/1085) +- Fixes http://git.chromium.org/webm/libwebp.git/info/refs not valid [#1175](https://github.com/SDWebImage/SDWebImage/pull/1175) + Reverted [#1193](https://github.com/SDWebImage/SDWebImage/pull/1193) + [#1177](https://github.com/SDWebImage/SDWebImage/pull/1177) +- 404 image url was causing the test to fail [0e761f4](https://github.com/SDWebImage/SDWebImage/commit/0e761f4) +- Fix for transparency being lost in transformed images. [#1121](https://github.com/SDWebImage/SDWebImage/pull/1121) +- Add handling for additional error codes that shouldn't be considered a permanent failure [#1159](https://github.com/SDWebImage/SDWebImage/pull/1159) +- add webp accepted content type only if `WebP` enabled [#1178](https://github.com/SDWebImage/SDWebImage/pull/1178) +- fix `ImageIO: CGImageSourceCreateWithData` data parameter is nil [#1167](https://github.com/SDWebImage/SDWebImage/pull/1167) +- Applied patch for issue [#1074](https://github.com/SDWebImage/SDWebImage/issues/1074) SDWebImage residing in swift module breaks the debugger [#1138](https://github.com/SDWebImage/SDWebImage/pull/1138) +- Fixed URLs with trailing parameters get assigned an incorrect image scale value [#1157](https://github.com/SDWebImage/SDWebImage/issues/1157) [#1158](https://github.com/SDWebImage/SDWebImage/pull/1158) +- Add newline to avoid compiler warning in `WebImage.h` [#1199](https://github.com/SDWebImage/SDWebImage/pull/1199) -## [3.7.2 Updated patch release for 3.7.0 on Mar 17th, 2015](https://github.com/rs/SDWebImage/releases/tag/3.7.2) +## [3.7.2 Updated patch release for 3.7.0 on Mar 17th, 2015](https://github.com/SDWebImage/SDWebImage/releases/tag/3.7.2) #### Updates - bumped `libwep` version to `0.4.3` #### Features: -- implement `SDWebImageDownloaderAllowInvalidSSLCertificates` option - [#937](https://github.com/rs/SDWebImage/pull/937) -- flag to transform animated images (`SDWebImageTransformAnimatedImage`) - [#703](https://github.com/rs/SDWebImage/pull/703) -- allows user to override default `SDWebImageDownloaderOperation` - [#876](https://github.com/rs/SDWebImage/pull/876) -- adds option to decompress images and select prefetcher queue - [#996](https://github.com/rs/SDWebImage/pull/996) +- implement `SDWebImageDownloaderAllowInvalidSSLCertificates` option - [#937](https://github.com/SDWebImage/SDWebImage/pull/937) +- flag to transform animated images (`SDWebImageTransformAnimatedImage`) - [#703](https://github.com/SDWebImage/SDWebImage/pull/703) +- allows user to override default `SDWebImageDownloaderOperation` - [#876](https://github.com/SDWebImage/SDWebImage/pull/876) +- adds option to decompress images and select prefetcher queue - [#996](https://github.com/SDWebImage/SDWebImage/pull/996) #### Fixes: -- fixed [#809](https://github.com/rs/SDWebImage/issues/809) `cancelAll` crash - [#838](https://github.com/rs/SDWebImage/pull/838) -- fixed [#900](https://github.com/rs/SDWebImage/issues/900) by adding a new flag `SD_LOG_NONE` that allows silencing the SD logs from the Prefetcher -- fixed [#895](https://github.com/rs/SDWebImage/issues/895) unsafe setImage in `setImageWithURL:` - [#896](https://github.com/rs/SDWebImage/pull/896) -- fix `NSNotificationCenter` dispatch on subthreads - [#987](https://github.com/rs/SDWebImage/pull/987) -- fix `SDWebImageDownloader` threading issue - [#104](https://github.com/rs/SDWebImage/pull/104)6 -- fixed duplicate failed urls are added into `failedURLs` - [#994](https://github.com/rs/SDWebImage/pull/994) -- increased default `maxConcurrentOperationCount`, fixes [#527](https://github.com/rs/SDWebImage/issues/527) - [#897](https://github.com/rs/SDWebImage/pull/897) -- handle empty urls `NSArray` - [#929](https://github.com/rs/SDWebImage/pull/929) -- decoding webp, depends on source image data alpha status - [#936](https://github.com/rs/SDWebImage/pull/936) -- fix [#610](https://github.com/rs/SDWebImage/issues/610) display progressive jpeg issue - [#840](https://github.com/rs/SDWebImage/pull/840) -- the code from `SDWebImageDownloaderOperation connection:didFailWithError:` should match the code from `connectionDidFinishLoading:`. This fixes [#872](https://github.com/rs/SDWebImage/issues/872) - [7f39e5e](https://github.com/rs/SDWebImage/commit/7f39e5e) -- `304 - Not Modified` HTTP status code handling - [#942](https://github.com/rs/SDWebImage/pull/942) -- cost compute fix - [#941](https://github.com/rs/SDWebImage/pull/941) -- initialise `kPNGSignatureData` data - [#981](https://github.com/rs/SDWebImage/pull/981) +- fixed [#809](https://github.com/SDWebImage/SDWebImage/issues/809) `cancelAll` crash - [#838](https://github.com/SDWebImage/SDWebImage/pull/838) +- fixed [#900](https://github.com/SDWebImage/SDWebImage/issues/900) by adding a new flag `SD_LOG_NONE` that allows silencing the SD logs from the Prefetcher +- fixed [#895](https://github.com/SDWebImage/SDWebImage/issues/895) unsafe setImage in `setImageWithURL:` - [#896](https://github.com/SDWebImage/SDWebImage/pull/896) +- fix `NSNotificationCenter` dispatch on subthreads - [#987](https://github.com/SDWebImage/SDWebImage/pull/987) +- fix `SDWebImageDownloader` threading issue - [#104](https://github.com/SDWebImage/SDWebImage/pull/104)6 +- fixed duplicate failed urls are added into `failedURLs` - [#994](https://github.com/SDWebImage/SDWebImage/pull/994) +- increased default `maxConcurrentOperationCount`, fixes [#527](https://github.com/SDWebImage/SDWebImage/issues/527) - [#897](https://github.com/SDWebImage/SDWebImage/pull/897) +- handle empty urls `NSArray` - [#929](https://github.com/SDWebImage/SDWebImage/pull/929) +- decoding webp, depends on source image data alpha status - [#936](https://github.com/SDWebImage/SDWebImage/pull/936) +- fix [#610](https://github.com/SDWebImage/SDWebImage/issues/610) display progressive jpeg issue - [#840](https://github.com/SDWebImage/SDWebImage/pull/840) +- the code from `SDWebImageDownloaderOperation connection:didFailWithError:` should match the code from `connectionDidFinishLoading:`. This fixes [#872](https://github.com/SDWebImage/SDWebImage/issues/872) - [7f39e5e](https://github.com/SDWebImage/SDWebImage/commit/7f39e5e) +- `304 - Not Modified` HTTP status code handling - [#942](https://github.com/SDWebImage/SDWebImage/pull/942) +- cost compute fix - [#941](https://github.com/SDWebImage/SDWebImage/pull/941) +- initialise `kPNGSignatureData` data - [#981](https://github.com/SDWebImage/SDWebImage/pull/981) #### Documentation - documentation updated -## [3.7.1 Patch release for 3.7.0 on Jul 23rd, 2014](https://github.com/rs/SDWebImage/releases/tag/3.7.1) +## [3.7.1 Patch release for 3.7.0 on Jul 23rd, 2014](https://github.com/SDWebImage/SDWebImage/releases/tag/3.7.1) -- fixed `sd_imageOrientationFromImageData:` crash if imageSource is nil - [#819](https://github.com/rs/SDWebImage/pull/819) [#813](https://github.com/rs/SDWebImage/pull/813) [#808](https://github.com/rs/SDWebImage/issues/808) [#828](https://github.com/rs/SDWebImage/issues/828) - temporary fix -- fixed `SDWebImageCombinedOperation cancel` crash (also visible as `SDWebImageManager cancelAll`) - [28109c4](https://github.com/rs/SDWebImage/commit/28109c4) [#798](https://github.com/rs/SDWebImage/issues/798) [#809](https://github.com/rs/SDWebImage/issues/809) -- fixed duplicate symbols when using with webp via pods - [#795](https://github.com/rs/SDWebImage/pull/795) -- fixed missing `mark` from `pragma mark` - [#827](https://github.com/rs/SDWebImage/pull/827) +- fixed `sd_imageOrientationFromImageData:` crash if imageSource is nil - [#819](https://github.com/SDWebImage/SDWebImage/pull/819) [#813](https://github.com/SDWebImage/SDWebImage/pull/813) [#808](https://github.com/SDWebImage/SDWebImage/issues/808) [#828](https://github.com/SDWebImage/SDWebImage/issues/828) - temporary fix +- fixed `SDWebImageCombinedOperation cancel` crash (also visible as `SDWebImageManager cancelAll`) - [28109c4](https://github.com/SDWebImage/SDWebImage/commit/28109c4) [#798](https://github.com/SDWebImage/SDWebImage/issues/798) [#809](https://github.com/SDWebImage/SDWebImage/issues/809) +- fixed duplicate symbols when using with webp via pods - [#795](https://github.com/SDWebImage/SDWebImage/pull/795) +- fixed missing `mark` from `pragma mark` - [#827](https://github.com/SDWebImage/SDWebImage/pull/827) -## [3.7.0 Xcode6, arm64, highlight UIImageView, imageURL ref, NTLM, ... on Jul 14th, 2014](https://github.com/rs/SDWebImage/releases/tag/3.7.0) +## [3.7.0 Xcode6, arm64, highlight UIImageView, imageURL ref, NTLM, ... on Jul 14th, 2014](https://github.com/SDWebImage/SDWebImage/releases/tag/3.7.0) ## Features -- Add category for imageView's highlighted state `UIImageView+HighlightedWebCache` - [#646](https://github.com/rs/SDWebImage/pull/646) [#765](https://github.com/rs/SDWebImage/pull/765) -- Keep a reference to the image URL - [#560](https://github.com/rs/SDWebImage/pull/560) -- Pass imageURL in completedBlock - [#770](https://github.com/rs/SDWebImage/pull/770) -- Implemented NTLM auth support. Replaced deprecated auth challenge methods from `NSURLConnectionDelegate` - [#711](https://github.com/rs/SDWebImage/pull/711) [50c4d1d](https://github.com/rs/SDWebImage/commit/50c4d1d) -- Ability to suspend image downloaders `SDWebImageDownloader setSuspended:` - [#734](https://github.com/rs/SDWebImage/pull/734) -- Delay the loading of the placeholder image until after load - [#701](https://github.com/rs/SDWebImage/pull/701) -- Ability to save images to cache directly - [#714](https://github.com/rs/SDWebImage/pull/714) -- Support for image orientation - [#764](https://github.com/rs/SDWebImage/pull/764) -- Added async `SDImageCache removeImageForKey:withCompletion:` - [#732](https://github.com/rs/SDWebImage/pull/732) [cd4b925](https://github.com/rs/SDWebImage/commit/cd4b925) -- Exposed cache paths - [#339](https://github.com/rs/SDWebImage/issues/339) -- Exposed `SDWebImageManager cacheKeyForURL:` - [5fd21e5](https://github.com/rs/SDWebImage/commit/5fd21e5) -- Exposing `SDWebImageManager` instance from the `SDWebImagePrefetcher` class - [6c409cd](https://github.com/rs/SDWebImage/commit/6c409cd) -- `SDWebImageManager` uses the shared instance of `SDWebImageDownloader` - [0772019](https://github.com/rs/SDWebImage/commit/0772019) -- Refactor the cancel logic - [#771](https://github.com/rs/SDWebImage/pull/771) [6d01e80](https://github.com/rs/SDWebImage/commit/6d01e80) [23874cd](https://github.com/rs/SDWebImage/commit/23874cd) [a6f11b3](https://github.com/rs/SDWebImage/commit/a6f11b3) -- Added method `SDWebImageManager cachedImageExistsForURL:` to check if an image exists in either the disk OR the memory cache - [#644](https://github.com/rs/SDWebImage/pull/644) -- Added option to use the cached image instead of the placeholder for `UIImageView`. Replaces [#541](https://github.com/rs/SDWebImage/pull/541) - [#599](https://github.com/rs/SDWebImage/issues/599) [30f6726](https://github.com/rs/SDWebImage/commit/30f6726) +- Add category for imageView's highlighted state `UIImageView+HighlightedWebCache` - [#646](https://github.com/SDWebImage/SDWebImage/pull/646) [#765](https://github.com/SDWebImage/SDWebImage/pull/765) +- Keep a reference to the image URL - [#560](https://github.com/SDWebImage/SDWebImage/pull/560) +- Pass imageURL in completedBlock - [#770](https://github.com/SDWebImage/SDWebImage/pull/770) +- Implemented NTLM auth support. Replaced deprecated auth challenge methods from `NSURLConnectionDelegate` - [#711](https://github.com/SDWebImage/SDWebImage/pull/711) [50c4d1d](https://github.com/SDWebImage/SDWebImage/commit/50c4d1d) +- Ability to suspend image downloaders `SDWebImageDownloader setSuspended:` - [#734](https://github.com/SDWebImage/SDWebImage/pull/734) +- Delay the loading of the placeholder image until after load - [#701](https://github.com/SDWebImage/SDWebImage/pull/701) +- Ability to save images to cache directly - [#714](https://github.com/SDWebImage/SDWebImage/pull/714) +- Support for image orientation - [#764](https://github.com/SDWebImage/SDWebImage/pull/764) +- Added async `SDImageCache removeImageForKey:withCompletion:` - [#732](https://github.com/SDWebImage/SDWebImage/pull/732) [cd4b925](https://github.com/SDWebImage/SDWebImage/commit/cd4b925) +- Exposed cache paths - [#339](https://github.com/SDWebImage/SDWebImage/issues/339) +- Exposed `SDWebImageManager cacheKeyForURL:` - [5fd21e5](https://github.com/SDWebImage/SDWebImage/commit/5fd21e5) +- Exposing `SDWebImageManager` instance from the `SDWebImagePrefetcher` class - [6c409cd](https://github.com/SDWebImage/SDWebImage/commit/6c409cd) +- `SDWebImageManager` uses the shared instance of `SDWebImageDownloader` - [0772019](https://github.com/SDWebImage/SDWebImage/commit/0772019) +- Refactor the cancel logic - [#771](https://github.com/SDWebImage/SDWebImage/pull/771) [6d01e80](https://github.com/SDWebImage/SDWebImage/commit/6d01e80) [23874cd](https://github.com/SDWebImage/SDWebImage/commit/23874cd) [a6f11b3](https://github.com/SDWebImage/SDWebImage/commit/a6f11b3) +- Added method `SDWebImageManager cachedImageExistsForURL:` to check if an image exists in either the disk OR the memory cache - [#644](https://github.com/SDWebImage/SDWebImage/pull/644) +- Added option to use the cached image instead of the placeholder for `UIImageView`. Replaces [#541](https://github.com/SDWebImage/SDWebImage/pull/541) - [#599](https://github.com/SDWebImage/SDWebImage/issues/599) [30f6726](https://github.com/SDWebImage/SDWebImage/commit/30f6726) - Created workspace + added unit tests target -- Updated documentation - [#476](https://github.com/rs/SDWebImage/issues/476) [#384](https://github.com/rs/SDWebImage/issues/384) [#526](https://github.com/rs/SDWebImage/issues/526) [#376](https://github.com/rs/SDWebImage/pull/376) [a8f5627](https://github.com/rs/SDWebImage/commit/a8f5627) +- Updated documentation - [#476](https://github.com/SDWebImage/SDWebImage/issues/476) [#384](https://github.com/SDWebImage/SDWebImage/issues/384) [#526](https://github.com/SDWebImage/SDWebImage/issues/526) [#376](https://github.com/SDWebImage/SDWebImage/pull/376) [a8f5627](https://github.com/SDWebImage/SDWebImage/commit/a8f5627) ## Bugfixes -- Fixed Xcode 6 builds - [#741](https://github.com/rs/SDWebImage/pull/741) [0b47342](https://github.com/rs/SDWebImage/commit/0b47342) -- Fixed `diskImageExistsWithKey:` deadlock - [#625](https://github.com/rs/SDWebImage/issues/625) [6e4fbaf](https://github.com/rs/SDWebImage/commit/6e4fbaf) +- Fixed Xcode 6 builds - [#741](https://github.com/SDWebImage/SDWebImage/pull/741) [0b47342](https://github.com/SDWebImage/SDWebImage/commit/0b47342) +- Fixed `diskImageExistsWithKey:` deadlock - [#625](https://github.com/SDWebImage/SDWebImage/issues/625) [6e4fbaf](https://github.com/SDWebImage/SDWebImage/commit/6e4fbaf) For consistency, added async methods in `SDWebImageManager` `cachedImageExistsForURL:completion:` and `diskImageExistsForURL:completion:` -- Fixed race condition that causes cancellation of one download operation to stop a run loop that is now used for another download operation. Race is introduced through `performSelector:onThread:withObject:waitUntilDone:` - [#698](https://github.com/rs/SDWebImage/pull/698) -- Fixed race condition between operation cancelation and loading finish - [39db378](https://github.com/rs/SDWebImage/commit/39db378) [#621](https://github.com/rs/SDWebImage/pull/621) [#783](https://github.com/rs/SDWebImage/pull/783) -- Fixed race condition in SDWebImageManager if one operation is cancelled - [f080e38](https://github.com/rs/SDWebImage/commit/f080e38) [#699](https://github.com/rs/SDWebImage/pull/699) -- Fixed issue where cancelled operations aren't removed from `runningOperations` - [#68](https://github.com/rs/SDWebImage/issues/68) -- Should not add url to failedURLs when timeout, cancel and so on - [#766](https://github.com/rs/SDWebImage/pull/766) [#707](https://github.com/rs/SDWebImage/issues/707) -- Fixed potential *object mutated while being enumerated* crash - [#727](https://github.com/rs/SDWebImage/pull/727) [#728](https://github.com/rs/SDWebImage/pull/728) (revert a threading fix from [#727](https://github.com/rs/SDWebImage/pull/727)) -- Fixed `NSURLConnection` response statusCode not valid (e.g. 404), downloader never stops its runloop and hangs the operation queue - [#735](https://github.com/rs/SDWebImage/pull/735) -- Fixed `SDWebImageRefreshCached` bug for large images - [#744](https://github.com/rs/SDWebImage/pull/744) -- Added proper handling for `SDWebImageDownloaderLowPriority` - [#713](https://github.com/rs/SDWebImage/issues/713) [#745](https://github.com/rs/SDWebImage/issues/745) -- Fixed fixing potential bug when sending a nil url for UIButton+WebCache - [#761](https://github.com/rs/SDWebImage/issues/761) [#763](https://github.com/rs/SDWebImage/pull/763) -- Fixed issue [#529](https://github.com/rs/SDWebImage/pull/529) - if the `cacheKeyFilter` was set, this was ignored when computing the `scaledImageForKey`. For most of the developers that did not set `cacheKeyFilter`, the code will work exactly the same - [eb91fdd](https://github.com/rs/SDWebImage/commit/eb91fdd) -- Returning error in setImage completedBlock if the url was nil. Added `dispatch_main_async_safe` macro - [#505](https://github.com/rs/SDWebImage/issues/505) [af3e4f8](https://github.com/rs/SDWebImage/commit/af3e4f8) -- Avoid premature completion of prefetcher if request fails - [#751](https://github.com/rs/SDWebImage/pull/751) -- Return nil from `SDScaledImageForKey` if the input image is nil - [#365](https://github.com/rs/SDWebImage/issues/365) [#750](https://github.com/rs/SDWebImage/pull/750) -- Do not load placeholder image if `SDWebImageDelayPlaceholder` option specified - [#780](https://github.com/rs/SDWebImage/pull/780) -- Make sure we call the `startPrefetchingAtIndex:` method from main queue - [#694](https://github.com/rs/SDWebImage/pull/694) -- Save image in cache before calling completion block - [#700](https://github.com/rs/SDWebImage/pull/700) -- Fixed arm64 warnings - [#685](https://github.com/rs/SDWebImage/pull/685) [#720](https://github.com/rs/SDWebImage/pull/720) [#721](https://github.com/rs/SDWebImage/pull/721) [#687](https://github.com/rs/SDWebImage/pull/687) -- Improved logging - [#721](https://github.com/rs/SDWebImage/pull/721) +- Fixed race condition that causes cancellation of one download operation to stop a run loop that is now used for another download operation. Race is introduced through `performSelector:onThread:withObject:waitUntilDone:` - [#698](https://github.com/SDWebImage/SDWebImage/pull/698) +- Fixed race condition between operation cancelation and loading finish - [39db378](https://github.com/SDWebImage/SDWebImage/commit/39db378) [#621](https://github.com/SDWebImage/SDWebImage/pull/621) [#783](https://github.com/SDWebImage/SDWebImage/pull/783) +- Fixed race condition in SDWebImageManager if one operation is cancelled - [f080e38](https://github.com/SDWebImage/SDWebImage/commit/f080e38) [#699](https://github.com/SDWebImage/SDWebImage/pull/699) +- Fixed issue where cancelled operations aren't removed from `runningOperations` - [#68](https://github.com/SDWebImage/SDWebImage/issues/68) +- Should not add url to failedURLs when timeout, cancel and so on - [#766](https://github.com/SDWebImage/SDWebImage/pull/766) [#707](https://github.com/SDWebImage/SDWebImage/issues/707) +- Fixed potential *object mutated while being enumerated* crash - [#727](https://github.com/SDWebImage/SDWebImage/pull/727) [#728](https://github.com/SDWebImage/SDWebImage/pull/728) (revert a threading fix from [#727](https://github.com/SDWebImage/SDWebImage/pull/727)) +- Fixed `NSURLConnection` response statusCode not valid (e.g. 404), downloader never stops its runloop and hangs the operation queue - [#735](https://github.com/SDWebImage/SDWebImage/pull/735) +- Fixed `SDWebImageRefreshCached` bug for large images - [#744](https://github.com/SDWebImage/SDWebImage/pull/744) +- Added proper handling for `SDWebImageDownloaderLowPriority` - [#713](https://github.com/SDWebImage/SDWebImage/issues/713) [#745](https://github.com/SDWebImage/SDWebImage/issues/745) +- Fixed fixing potential bug when sending a nil url for UIButton+WebCache - [#761](https://github.com/SDWebImage/SDWebImage/issues/761) [#763](https://github.com/SDWebImage/SDWebImage/pull/763) +- Fixed issue [#529](https://github.com/SDWebImage/SDWebImage/pull/529) - if the `cacheKeyFilter` was set, this was ignored when computing the `scaledImageForKey`. For most of the developers that did not set `cacheKeyFilter`, the code will work exactly the same - [eb91fdd](https://github.com/SDWebImage/SDWebImage/commit/eb91fdd) +- Returning error in setImage completedBlock if the url was nil. Added `dispatch_main_async_safe` macro - [#505](https://github.com/SDWebImage/SDWebImage/issues/505) [af3e4f8](https://github.com/SDWebImage/SDWebImage/commit/af3e4f8) +- Avoid premature completion of prefetcher if request fails - [#751](https://github.com/SDWebImage/SDWebImage/pull/751) +- Return nil from `SDScaledImageForKey` if the input image is nil - [#365](https://github.com/SDWebImage/SDWebImage/issues/365) [#750](https://github.com/SDWebImage/SDWebImage/pull/750) +- Do not load placeholder image if `SDWebImageDelayPlaceholder` option specified - [#780](https://github.com/SDWebImage/SDWebImage/pull/780) +- Make sure we call the `startPrefetchingAtIndex:` method from main queue - [#694](https://github.com/SDWebImage/SDWebImage/pull/694) +- Save image in cache before calling completion block - [#700](https://github.com/SDWebImage/SDWebImage/pull/700) +- Fixed arm64 warnings - [#685](https://github.com/SDWebImage/SDWebImage/pull/685) [#720](https://github.com/SDWebImage/SDWebImage/pull/720) [#721](https://github.com/SDWebImage/SDWebImage/pull/721) [#687](https://github.com/SDWebImage/SDWebImage/pull/687) +- Improved logging - [#721](https://github.com/SDWebImage/SDWebImage/pull/721) - Added `SDWebImageCompat.m` to `SDWebImage+MKAnnotation` target -## [3.6 Fix and cleanup on Mar 24th, 2014](https://github.com/rs/SDWebImage/releases/tag/3.6) +## [3.6 Fix and cleanup on Mar 24th, 2014](https://github.com/SDWebImage/SDWebImage/releases/tag/3.6) -## [3.5.4 ARM64 Support on Feb 24th, 2014](https://github.com/rs/SDWebImage/releases/tag/3.5.4) +## [3.5.4 ARM64 Support on Feb 24th, 2014](https://github.com/SDWebImage/SDWebImage/releases/tag/3.5.4) -## [3.5.3 on Jan 7th, 2014](https://github.com/rs/SDWebImage/releases/tag/3.5.3) +## [3.5.3 on Jan 7th, 2014](https://github.com/SDWebImage/SDWebImage/releases/tag/3.5.3) -## [3.5.2 on Jan 2nd, 2014](https://github.com/rs/SDWebImage/releases/tag/3.5.2) +## [3.5.2 on Jan 2nd, 2014](https://github.com/SDWebImage/SDWebImage/releases/tag/3.5.2) -## [3.5.1 on Dec 3rd, 2013](https://github.com/rs/SDWebImage/releases/tag/3.5.1) +## [3.5.1 on Dec 3rd, 2013](https://github.com/SDWebImage/SDWebImage/releases/tag/3.5.1) -## [3.5 WebP Target, iOS 7, Fixes on Oct 4th, 2013](https://github.com/rs/SDWebImage/releases/tag/3.5) +## [3.5 WebP Target, iOS 7, Fixes on Oct 4th, 2013](https://github.com/SDWebImage/SDWebImage/releases/tag/3.5) - Fix iOS 7 related issues - Move `WebP` support to a dedicated target @@ -716,68 +735,68 @@ For consistency, added async methods in `SDWebImageManager` `cachedImageExistsFo - Fix timeout issue - Add some methods that allow to check if an image exists on disk without taking it off disk and decompressing it first -## [3.4 Animated image category, bug fixes on Aug 13th, 2013](https://github.com/rs/SDWebImage/releases/tag/3.4) +## [3.4 Animated image category, bug fixes on Aug 13th, 2013](https://github.com/SDWebImage/SDWebImage/releases/tag/3.4) - Add `calculateSizeWithCompletionBlock` - Add multiple download of images for animationImages property of `UIImageView` -- Add background task for disk cleanup [#306](https://github.com/rs/SDWebImage/issues/306) -- Fix dead thread issue on iOS 5 [#444](https://github.com/rs/SDWebImage/pull/444), [#399](https://github.com/rs/SDWebImage/issues/399), [#466](https://github.com/rs/SDWebImage/issues/466) -- Make IO operations cancelable to fix perf issue with heavy images [#462](https://github.com/rs/SDWebImage/issues/462) -- Fix crash `Collection <__NSArrayM: ...> was mutated while being enumerated.` [#471](https://github.com/rs/SDWebImage/pull/471) +- Add background task for disk cleanup [#306](https://github.com/SDWebImage/SDWebImage/issues/306) +- Fix dead thread issue on iOS 5 [#444](https://github.com/SDWebImage/SDWebImage/pull/444), [#399](https://github.com/SDWebImage/SDWebImage/issues/399), [#466](https://github.com/SDWebImage/SDWebImage/issues/466) +- Make IO operations cancelable to fix perf issue with heavy images [#462](https://github.com/SDWebImage/SDWebImage/issues/462) +- Fix crash `Collection <__NSArrayM: ...> was mutated while being enumerated.` [#471](https://github.com/SDWebImage/SDWebImage/pull/471) -## [3.3 WebP, Animated GIF and more on Jun 14th, 2013](https://github.com/rs/SDWebImage/releases/tag/3.3) +## [3.3 WebP, Animated GIF and more on Jun 14th, 2013](https://github.com/SDWebImage/SDWebImage/releases/tag/3.3) -- WebP image format support [#410](https://github.com/rs/SDWebImage/issues/410) -- Animated GIF support [#375](https://github.com/rs/SDWebImage/pull/375) -- Custom image cache search paths [#156](https://github.com/rs/SDWebImage/pull/156) +- WebP image format support [#410](https://github.com/SDWebImage/SDWebImage/issues/410) +- Animated GIF support [#375](https://github.com/SDWebImage/SDWebImage/pull/375) +- Custom image cache search paths [#156](https://github.com/SDWebImage/SDWebImage/pull/156) - Bug fixes -## [3.2 Bug fixes on Mar 13th, 2013](https://github.com/rs/SDWebImage/releases/tag/3.2) +## [3.2 Bug fixes on Mar 13th, 2013](https://github.com/SDWebImage/SDWebImage/releases/tag/3.2) -- `SDWebImageRefreshCached` download option [#326](https://github.com/rs/SDWebImage/pull/326) -- New `SDWebImageManager` delegate methods [ebd63a88c1](https://github.com/rs/SDWebImage/commit/ebd63a88c116ac7acfbeded5c84d0fffa2443438) -- Fix long standing issue with alpha en JPEGs [#299](https://github.com/rs/SDWebImage/pull/299) -- Add synchronous disk-cache loading method [#297](https://github.com/rs/SDWebImage/pull/297) +- `SDWebImageRefreshCached` download option [#326](https://github.com/SDWebImage/SDWebImage/pull/326) +- New `SDWebImageManager` delegate methods [ebd63a88c1](https://github.com/SDWebImage/SDWebImage/commit/ebd63a88c116ac7acfbeded5c84d0fffa2443438) +- Fix long standing issue with alpha en JPEGs [#299](https://github.com/SDWebImage/SDWebImage/pull/299) +- Add synchronous disk-cache loading method [#297](https://github.com/SDWebImage/SDWebImage/pull/297) - Fix `SDWebImageCacheMemoryOnly` flag - Bug fixes -## [3.1 Bug fixes on Jan 21st, 2013](https://github.com/rs/SDWebImage/releases/tag/3.1) +## [3.1 Bug fixes on Jan 21st, 2013](https://github.com/SDWebImage/SDWebImage/releases/tag/3.1) -## [3.0 Complete rewrite on Nov 29th, 2012](https://github.com/rs/SDWebImage/releases/tag/3.0) +## [3.0 Complete rewrite on Nov 29th, 2012](https://github.com/SDWebImage/SDWebImage/releases/tag/3.0) - Complete rewrite of the library using `GCD`, `ARC`, `NSCache` and blocks - Drop compatibility with iOS 3 and 4 -## [2.7.4 Bug fixes on Nov 14th, 2012](https://github.com/rs/SDWebImage/releases/tag/2.7.4) +## [2.7.4 Bug fixes on Nov 14th, 2012](https://github.com/SDWebImage/SDWebImage/releases/tag/2.7.4) -## [2.7.3 on Nov 3rd, 2012](https://github.com/rs/SDWebImage/releases/tag/2.7.3) +## [2.7.3 on Nov 3rd, 2012](https://github.com/SDWebImage/SDWebImage/releases/tag/2.7.3) -## [2.7.2 on Oct 23rd, 2012](https://github.com/rs/SDWebImage/releases/tag/2.7.2) +## [2.7.2 on Oct 23rd, 2012](https://github.com/SDWebImage/SDWebImage/releases/tag/2.7.2) -## [2.7.1 on Oct 19th, 2012](https://github.com/rs/SDWebImage/releases/tag/2.7.1) +## [2.7.1 on Oct 19th, 2012](https://github.com/SDWebImage/SDWebImage/releases/tag/2.7.1) -## [2.7 on Sep 8th, 2012](https://github.com/rs/SDWebImage/releases/tag/2.7) +## [2.7 on Sep 8th, 2012](https://github.com/SDWebImage/SDWebImage/releases/tag/2.7) -## [2.6 on May 4th, 2012](https://github.com/rs/SDWebImage/releases/tag/2.6) +## [2.6 on May 4th, 2012](https://github.com/SDWebImage/SDWebImage/releases/tag/2.6) -## [2.5 on Mar 22nd, 2012](https://github.com/rs/SDWebImage/releases/tag/2.5) +## [2.5 on Mar 22nd, 2012](https://github.com/SDWebImage/SDWebImage/releases/tag/2.5) -## [2.4 on Oct 1st, 2011](https://github.com/rs/SDWebImage/releases/tag/2.4) +## [2.4 on Oct 1st, 2011](https://github.com/SDWebImage/SDWebImage/releases/tag/2.4) -## [2.3 on Sep 16th, 2010](https://github.com/rs/SDWebImage/releases/tag/2.3) +## [2.3 on Sep 16th, 2010](https://github.com/SDWebImage/SDWebImage/releases/tag/2.3) -## [2.2 on Aug 29th, 2010](https://github.com/rs/SDWebImage/releases/tag/2.2) +## [2.2 on Aug 29th, 2010](https://github.com/SDWebImage/SDWebImage/releases/tag/2.2) -## [2.1.0 on Jun 12th, 2010](https://github.com/rs/SDWebImage/releases/tag/2.1.0) +## [2.1.0 on Jun 12th, 2010](https://github.com/SDWebImage/SDWebImage/releases/tag/2.1.0) -## [2.1 on Jun 12th, 2010](https://github.com/rs/SDWebImage/releases/tag/2.1) +## [2.1 on Jun 12th, 2010](https://github.com/SDWebImage/SDWebImage/releases/tag/2.1) -## [2.0.0 on Jun 9th, 2010](https://github.com/rs/SDWebImage/releases/tag/2.0.0) +## [2.0.0 on Jun 9th, 2010](https://github.com/SDWebImage/SDWebImage/releases/tag/2.0.0) -## [2.0 on Jun 9th, 2010](https://github.com/rs/SDWebImage/releases/tag/2.0) +## [2.0 on Jun 9th, 2010](https://github.com/SDWebImage/SDWebImage/releases/tag/2.0) -## [1.0.0 on Dec 31st, 2009](https://github.com/rs/SDWebImage/releases/tag/1.0.0) +## [1.0.0 on Dec 31st, 2009](https://github.com/SDWebImage/SDWebImage/releases/tag/1.0.0) -## [1.0 on Dec 31st, 2009](https://github.com/rs/SDWebImage/releases/tag/1.0) +## [1.0 on Dec 31st, 2009](https://github.com/SDWebImage/SDWebImage/releases/tag/1.0) diff --git a/Docs/ManualInstallation.md b/Docs/ManualInstallation.md index ae059a62..b12f67db 100644 --- a/Docs/ManualInstallation.md +++ b/Docs/ManualInstallation.md @@ -2,7 +2,7 @@ In order to gain access to all the files from the repository, you should clone it. ``` -git clone --recursive https://github.com/rs/SDWebImage.git +git clone --recursive https://github.com/SDWebImage/SDWebImage.git ``` ... TO BE CHECKED AND DESCRIBED IN DETAIL diff --git a/Docs/SDWebImage-4.0-Migration-guide.md b/Docs/SDWebImage-4.0-Migration-guide.md index 486eb56c..715889c9 100644 --- a/Docs/SDWebImage-4.0-Migration-guide.md +++ b/Docs/SDWebImage-4.0-Migration-guide.md @@ -14,7 +14,7 @@ This guide is provided in order to ease the transition of existing applications SDWebImage 4.0 officially supports iOS 7 and later, Mac OS X 10.8 and later, watchOS 2 and later and tvOS 9 and later. It needs Xcode 7.3 or later to be able to build everything properly. -For targeting previous versions of the SDKs, check [README - Backwards compatibility](https://github.com/rs/SDWebImage#backwards-compatibility) +For targeting previous versions of the SDKs, check [README - Backwards compatibility](https://github.com/SDWebImage/SDWebImage#backwards-compatibility) . ### Migration diff --git a/README.md b/README.md index 7f75e3ad..18cda1a7 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,14 @@

- +

-[![Build Status](http://img.shields.io/travis/rs/SDWebImage/master.svg?style=flat)](https://travis-ci.org/rs/SDWebImage) +[![Build Status](http://img.shields.io/travis/SDWebImage/SDWebImage/master.svg?style=flat)](https://travis-ci.org/SDWebImage/SDWebImage) [![Pod Version](http://img.shields.io/cocoapods/v/SDWebImage.svg?style=flat)](http://cocoadocs.org/docsets/SDWebImage/) [![Pod Platform](http://img.shields.io/cocoapods/p/SDWebImage.svg?style=flat)](http://cocoadocs.org/docsets/SDWebImage/) [![Pod License](http://img.shields.io/cocoapods/l/SDWebImage.svg?style=flat)](https://www.apache.org/licenses/LICENSE-2.0.html) -[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/rs/SDWebImage) -[![codecov](https://codecov.io/gh/rs/SDWebImage/branch/master/graph/badge.svg)](https://codecov.io/gh/rs/SDWebImage) +[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/SDWebImage/SDWebImage) +[![codecov](https://codecov.io/gh/SDWebImage/SDWebImage/branch/master/graph/badge.svg)](https://codecov.io/gh/SDWebImage/SDWebImage) This library provides an async image downloader with cache support. For convenience, we added categories for UI elements like `UIImageView`, `UIButton`, `MKAnnotationView`. @@ -18,11 +18,11 @@ This library provides an async image downloader with cache support. For convenie - [x] An asynchronous image downloader - [x] An asynchronous memory + disk image caching with automatic cache expiration handling - [x] A background image decompression -- [x] Improved [support for animated images](https://github.com/rs/SDWebImage/wiki/Advanced-Usage#animated-image-50) -- [x] [Customizable and composable transformations](https://github.com/rs/SDWebImage/wiki/Advanced-Usage#transformer-50) can be applied to the images right after download -- [x] [Custom cache control](https://github.com/rs/SDWebImage/wiki/Advanced-Usage#custom-cache-50) -- [x] Expand the image loading capabilites by adding your [own custom loaders](https://github.com/rs/SDWebImage/wiki/Advanced-Usage#custom-loader-50) or using prebuilt loaders like [FLAnimatedImage plugin](https://github.com/SDWebImage/SDWebImageFLPlugin) or [Photos Library plugin](https://github.com/SDWebImage/SDWebImagePhotosPlugin) -- [x] [Loading indicators](https://github.com/rs/SDWebImage/wiki/How-to-use#use-view-indicator-50) +- [x] Improved [support for animated images](https://github.com/SDWebImage/SDWebImage/wiki/Advanced-Usage#animated-image-50) +- [x] [Customizable and composable transformations](https://github.com/SDWebImage/SDWebImage/wiki/Advanced-Usage#transformer-50) can be applied to the images right after download +- [x] [Custom cache control](https://github.com/SDWebImage/SDWebImage/wiki/Advanced-Usage#custom-cache-50) +- [x] Expand the image loading capabilites by adding your [own custom loaders](https://github.com/SDWebImage/SDWebImage/wiki/Advanced-Usage#custom-loader-50) or using prebuilt loaders like [FLAnimatedImage plugin](https://github.com/SDWebImage/SDWebImageFLPlugin) or [Photos Library plugin](https://github.com/SDWebImage/SDWebImagePhotosPlugin) +- [x] [Loading indicators](https://github.com/SDWebImage/SDWebImage/wiki/How-to-use#use-view-indicator-50) - [x] A guarantee that the same URL won't be downloaded several times - [x] A guarantee that bogus URLs won't be retried again and again - [x] A guarantee that main thread will never be blocked @@ -68,25 +68,25 @@ You can use those directly, or create similar components of your own. #### Backwards compatibility -- For iOS 7, macOS 10.9 or Xcode < 8, use [any 4.x version up to 4.3.3](https://github.com/rs/SDWebImage/releases/tag/4.3.3) -- For macOS 10.8, use [any 4.x version up to 4.3.0](https://github.com/rs/SDWebImage/releases/tag/4.3.0) -- For iOS 5 and 6, use [any 3.x version up to 3.7.6](https://github.com/rs/SDWebImage/tag/3.7.6) -- For iOS < 5.0, please use the last [2.0 version](https://github.com/rs/SDWebImage/tree/2.0-compat). +- For iOS 7, macOS 10.9 or Xcode < 8, use [any 4.x version up to 4.3.3](https://github.com/SDWebImage/SDWebImage/releases/tag/4.3.3) +- For macOS 10.8, use [any 4.x version up to 4.3.0](https://github.com/SDWebImage/SDWebImage/releases/tag/4.3.0) +- For iOS 5 and 6, use [any 3.x version up to 3.7.6](https://github.com/SDWebImage/SDWebImage/tag/3.7.6) +- For iOS < 5.0, please use the last [2.0 version](https://github.com/SDWebImage/SDWebImage/tree/2.0-compat). ## Getting Started - Read this Readme doc -- Read the [How to use section](https://github.com/rs/SDWebImage#how-to-use) +- Read the [How to use section](https://github.com/SDWebImage/SDWebImage#how-to-use) - Read the [Documentation @ CocoaDocs](http://cocoadocs.org/docsets/SDWebImage/) - Try the example by downloading the project from Github or even easier using CocoaPods try `pod try SDWebImage` -- Read the [Installation Guide](https://github.com/rs/SDWebImage/wiki/Installation-Guide) -- Read the [SDWebImage 5.0 Migration Guide](https://raw.githubusercontent.com/rs/SDWebImage/5.x/Docs/SDWebImage-5.0-Migration-guide.md) to get an idea of the changes from 4.x to 5.x -- Read the [SDWebImage 4.0 Migration Guide](https://raw.githubusercontent.com/rs/SDWebImage/master/Docs/SDWebImage-4.0-Migration-guide.md) to get an idea of the changes from 3.x to 4.x -- Read the [Common Problems](https://github.com/rs/SDWebImage/wiki/Common-Problems) to find the solution for common problems -- Go to the [Wiki Page](https://github.com/rs/SDWebImage/wiki) for more information such as [Advanced Usage](https://github.com/rs/SDWebImage/wiki/Advanced-Usage) +- Read the [Installation Guide](https://github.com/SDWebImage/SDWebImage/wiki/Installation-Guide) +- Read the [SDWebImage 5.0 Migration Guide](https://raw.githubusercontent.com/SDWebImage/SDWebImage/5.x/Docs/SDWebImage-5.0-Migration-guide.md) to get an idea of the changes from 4.x to 5.x +- Read the [SDWebImage 4.0 Migration Guide](https://raw.githubusercontent.com/SDWebImage/SDWebImage/master/Docs/SDWebImage-4.0-Migration-guide.md) to get an idea of the changes from 3.x to 4.x +- Read the [Common Problems](https://github.com/SDWebImage/SDWebImage/wiki/Common-Problems) to find the solution for common problems +- Go to the [Wiki Page](https://github.com/SDWebImage/SDWebImage/wiki) for more information such as [Advanced Usage](https://github.com/SDWebImage/SDWebImage/wiki/Advanced-Usage) ## Who Uses It -- Find out [who uses SDWebImage](https://github.com/rs/SDWebImage/wiki/Who-Uses-SDWebImage) and add your app to the list. +- Find out [who uses SDWebImage](https://github.com/SDWebImage/SDWebImage/wiki/Who-Uses-SDWebImage) and add your app to the list. ## Communication @@ -94,7 +94,7 @@ You can use those directly, or create similar components of your own. - If you'd like to **ask a general question**, use [Stack Overflow](http://stackoverflow.com/questions/tagged/sdwebimage). - If you **found a bug**, open an issue. - If you **have a feature request**, open an issue. -- If you **want to contribute**, read the [Contributing Guide](https://raw.githubusercontent.com/rs/SDWebImage/master/.github/CONTRIBUTING.md) +- If you **want to contribute**, read the [Contributing Guide](https://raw.githubusercontent.com/SDWebImage/SDWebImage/master/.github/CONTRIBUTING.md) ## How To Use @@ -115,12 +115,12 @@ import SDWebImage imageView.sd_setImage(with: URL(string: "http://www.domain.com/path/to/image.jpg"), placeholderImage: UIImage(named: "placeholder.png")) ``` -- For details about how to use the library and clear examples, see [The detailed How to use](https://raw.githubusercontent.com/rs/SDWebImage/master/Docs/HowToUse.md) +- For details about how to use the library and clear examples, see [The detailed How to use](https://raw.githubusercontent.com/SDWebImage/SDWebImage/master/Docs/HowToUse.md) ## Animated Images (GIF) support In 5.0, we introduced a brand new mechanism for supporting animated images. This includes animated image loading, rendering, decoding, and also supports customizations (for advanced users). -This animated image solution is available for `iOS`/`tvOS`/`macOS`. The `SDAnimatedImage` is subclass of `UIImage/NSImage`, and `SDAnimatedImageView` is subclass of `UIImageView/NSImageView`, to make them compatible with the common frameworks APIs. See [Animated Image](https://github.com/rs/SDWebImage/wiki/Advanced-Usage#animated-image-50) for more detailed information. +This animated image solution is available for `iOS`/`tvOS`/`macOS`. The `SDAnimatedImage` is subclass of `UIImage/NSImage`, and `SDAnimatedImageView` is subclass of `UIImageView/NSImageView`, to make them compatible with the common frameworks APIs. See [Animated Image](https://github.com/SDWebImage/SDWebImage/wiki/Advanced-Usage#animated-image-50) for more detailed information. #### FLAnimatedImage integration has its own dedicated repo In order to clean up things and make our core project do less things, we decided that the `FLAnimatedImage` integration does not belong here. From 5.0, this will still be available, but under a dedicated repo [SDWebImageFLPlugin](https://github.com/SDWebImage/SDWebImageFLPlugin). @@ -165,14 +165,14 @@ To install with carthage, follow the instruction on [Carthage](https://github.co Carthage users can point to this repository and use whichever generated framework they'd like: SDWebImage, SDWebImageMapKit or both. -Make the following entry in your Cartfile: `github "rs/SDWebImage"` +Make the following entry in your Cartfile: `github "SDWebImage/SDWebImage"` Then run `carthage update` If this is your first time using Carthage in the project, you'll need to go through some additional steps as explained [over at Carthage](https://github.com/Carthage/Carthage#adding-frameworks-to-an-application). > NOTE: At this time, Carthage does not provide a way to build only specific repository subcomponents (or equivalent of CocoaPods's subspecs). All components and their dependencies will be built with the above command. However, you don't need to copy frameworks you aren't using into your project. For instance, if you aren't using `SDWebImageMapKit`, feel free to delete that framework from the Carthage Build directory after `carthage update` completes. ### Installation by cloning the repository -- see [Manual install](https://raw.githubusercontent.com/rs/SDWebImage/master/Docs/ManualInstallation.md) +- see [Manual install](https://raw.githubusercontent.com/SDWebImage/SDWebImage/master/Docs/ManualInstallation.md) ### Import headers in your source files @@ -199,32 +199,32 @@ community can help you solve it. ## Licenses -All source code is licensed under the [MIT License](https://raw.github.com/rs/SDWebImage/master/LICENSE). +All source code is licensed under the [MIT License](https://raw.github.com/SDWebImage/SDWebImage/master/LICENSE). ## Architecture #### High Level Diagram

- +

#### Overall Class Diagram

- +

#### Top Level API Diagram

- +

#### Main Sequence Diagram

- +

#### More detailed diagrams -- [Manager API Diagram](https://raw.githubusercontent.com/rs/SDWebImage/5.x/Docs/Diagrams/SDWebImageManagerClassDiagram.png) -- [Coders API Diagram](https://raw.githubusercontent.com/rs/SDWebImage/5.x/Docs/Diagrams/SDWebImageCodersClassDiagram.png) -- [Loader API Diagram](https://raw.githubusercontent.com/rs/SDWebImage/5.x/Docs/Diagrams/SDWebImageLoaderClassDiagram.png) -- [Cache API Diagram](https://raw.githubusercontent.com/rs/SDWebImage/5.x/Docs/Diagrams/SDWebImageCacheClassDiagram.png) +- [Manager API Diagram](https://raw.githubusercontent.com/SDWebImage/SDWebImage/5.x/Docs/Diagrams/SDWebImageManagerClassDiagram.png) +- [Coders API Diagram](https://raw.githubusercontent.com/SDWebImage/SDWebImage/5.x/Docs/Diagrams/SDWebImageCodersClassDiagram.png) +- [Loader API Diagram](https://raw.githubusercontent.com/SDWebImage/SDWebImage/5.x/Docs/Diagrams/SDWebImageLoaderClassDiagram.png) +- [Cache API Diagram](https://raw.githubusercontent.com/SDWebImage/SDWebImage/5.x/Docs/Diagrams/SDWebImageCacheClassDiagram.png) diff --git a/SDWebImage.podspec b/SDWebImage.podspec index 860e9fdc..288bab62 100644 --- a/SDWebImage.podspec +++ b/SDWebImage.podspec @@ -9,9 +9,9 @@ Pod::Spec.new do |s| s.license = 'MIT' s.summary = 'Asynchronous image downloader with cache support with an UIImageView category.' - s.homepage = 'https://github.com/rs/SDWebImage' + s.homepage = 'https://github.com/SDWebImage/SDWebImage' s.author = { 'Olivier Poitrey' => 'rs@dailymotion.com' } - s.source = { :git => 'https://github.com/rs/SDWebImage.git', :tag => s.version.to_s } + s.source = { :git => 'https://github.com/SDWebImage/SDWebImage.git', :tag => s.version.to_s } s.description = 'This library provides a category for UIImageView with support for remote ' \ 'images coming from the web. It provides an UIImageView category adding web ' \ diff --git a/SDWebImage/SDDiskCache.m b/SDWebImage/SDDiskCache.m index feb4d65a..13e6f329 100644 --- a/SDWebImage/SDDiskCache.m +++ b/SDWebImage/SDDiskCache.m @@ -267,15 +267,21 @@ #pragma mark - Hash -static inline NSString * _Nullable SDDiskCacheFileNameForKey(NSString * _Nullable key) { +#define SD_MAX_FILE_EXTENSION_LENGTH (NAME_MAX - CC_MD5_DIGEST_LENGTH * 2 - 1) + +static inline NSString * _Nonnull SDDiskCacheFileNameForKey(NSString * _Nullable key) { const char *str = key.UTF8String; if (str == NULL) { - return nil; + str = ""; } unsigned char r[CC_MD5_DIGEST_LENGTH]; CC_MD5(str, (CC_LONG)strlen(str), r); NSURL *keyURL = [NSURL URLWithString:key]; NSString *ext = keyURL ? keyURL.pathExtension : key.pathExtension; + // File system has file name length limit, we need to check if ext is too long, we don't add it to the filename + if (ext.length > SD_MAX_FILE_EXTENSION_LENGTH) { + ext = nil; + } NSString *filename = [NSString stringWithFormat:@"%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%@", r[0], r[1], r[2], r[3], r[4], r[5], r[6], r[7], r[8], r[9], r[10], r[11], r[12], r[13], r[14], r[15], ext.length == 0 ? @"" : [NSString stringWithFormat:@".%@", ext]]; diff --git a/SDWebImage/SDImageCache.m b/SDWebImage/SDImageCache.m index 9b0a63a4..6a093511 100644 --- a/SDWebImage/SDImageCache.m +++ b/SDWebImage/SDImageCache.m @@ -404,12 +404,13 @@ @autoreleasepool { NSData *diskData = [self diskImageDataBySearchingAllPathsForKey:key]; UIImage *diskImage; - SDImageCacheType cacheType = SDImageCacheTypeDisk; + SDImageCacheType cacheType = SDImageCacheTypeNone; if (image) { // the image is from in-memory cache, but need image data diskImage = image; cacheType = SDImageCacheTypeMemory; } else if (diskData) { + cacheType = SDImageCacheTypeDisk; // decode image data only if in-memory cache missed diskImage = [self diskImageForKey:key data:diskData options:options context:context]; if (diskImage && self.config.shouldCacheImagesInMemory) { diff --git a/Tests/Tests/SDImageCacheTests.m b/Tests/Tests/SDImageCacheTests.m index c4784ad0..b2bdd77c 100644 --- a/Tests/Tests/SDImageCacheTests.m +++ b/Tests/Tests/SDImageCacheTests.m @@ -244,12 +244,25 @@ static NSString *kTestImageKeyPNG = @"TestImageKey.png"; expect([cachePath pathExtension]).to.equal(@""); } -#if SD_UIKIT +- (void)test36CachePathForKeyWithURLQueryParams { + NSString *urlString = @"https://imggen.alicdn.com/3b11cea896a9438329d85abfb07b30a8.jpg?aid=tanx&tid=1166&m=%7B%22img_url%22%3A%22https%3A%2F%2Fgma.alicdn.com%2Fbao%2Fuploaded%2Fi4%2F1695306010722305097%2FTB2S2KjkHtlpuFjSspoXXbcDpXa_%21%210-saturn_solar.jpg_sum.jpg%22%2C%22title%22%3A%22%E6%A4%8D%E7%89%A9%E8%94%B7%E8%96%87%E7%8E%AB%E7%91%B0%E8%8A%B1%22%2C%22promot_name%22%3A%22%22%2C%22itemid%22%3A%22546038044448%22%7D&e=cb88dab197bfaa19804f6ec796ca906dab536b88fe6d4475795c7ee661a7ede1&size=640x246"; + NSString *cachePath = [[SDImageCache sharedImageCache] cachePathForKey:urlString]; + expect(cachePath).toNot.beNil(); + expect([cachePath pathExtension]).to.equal(@"jpg"); +} + +- (void)test37CachePathForKeyWithTooLongExtension { + NSString *urlString = @"https://imggen.alicdn.com/3b11cea896a9438329d85abfb07b30a8.jpgasaaaaaaaaaaaaaaaaaaaajjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjaaaaaaaaaaaaaaaaajjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj"; + NSString *cachePath = [[SDImageCache sharedImageCache] cachePathForKey:urlString]; + expect(cachePath).toNot.beNil(); + expect([cachePath pathExtension]).to.equal(@""); +} + - (void)test40InsertionOfImageData { XCTestExpectation *expectation = [self expectationWithDescription:@"Insertion of image data works"]; UIImage *image = [[UIImage alloc] initWithContentsOfFile:[self testJPEGPath]]; - NSData *imageData = UIImageJPEGRepresentation(image, 1.0); + NSData *imageData = [image sd_imageDataAsFormat:SDImageFormatJPEG]; [[SDImageCache sharedImageCache] storeImageDataToDisk:imageData forKey:kTestImageKeyJPEG]; UIImage *storedImageFromMemory = [[SDImageCache sharedImageCache] imageFromMemoryCacheForKey:kTestImageKeyJPEG]; @@ -257,7 +270,7 @@ static NSString *kTestImageKeyPNG = @"TestImageKey.png"; NSString *cachePath = [[SDImageCache sharedImageCache] cachePathForKey:kTestImageKeyJPEG]; UIImage *cachedImage = [[UIImage alloc] initWithContentsOfFile:cachePath]; - NSData *storedImageData = UIImageJPEGRepresentation(cachedImage, 1.0); + NSData *storedImageData = [cachedImage sd_imageDataAsFormat:SDImageFormatJPEG]; expect(storedImageData.length).to.beGreaterThan(0); expect(cachedImage.size).to.equal(image.size); // can't directly compare image and cachedImage because apparently there are some slight differences, even though the image is the same @@ -304,8 +317,8 @@ static NSString *kTestImageKeyPNG = @"TestImageKey.png"; NSString * decodedImagePath = [[NSBundle bundleForClass:[self class]] pathForResource:@"TestImage" ofType:@"jpg"]; UIImage *testJPEGImage = [[UIImage alloc] initWithContentsOfFile:decodedImagePath]; - NSData *data1 = UIImagePNGRepresentation(testJPEGImage); - NSData *data2 = UIImagePNGRepresentation(diskCacheImage); + NSData *data1 = [testJPEGImage sd_imageDataAsFormat:SDImageFormatPNG]; + NSData *data2 = [diskCacheImage sd_imageDataAsFormat:SDImageFormatPNG]; if (![data1 isEqualToData:data2]) { XCTFail(@"Custom decoder not work for SDImageCache, check -[SDWebImageTestDecoder decodedImageWithData:]"); @@ -320,7 +333,6 @@ static NSString *kTestImageKeyPNG = @"TestImageKey.png"; [self waitForExpectationsWithCommonTimeout]; } -#endif - (void)test41StoreImageDataToDiskWithCustomFileManager { NSData *imageData = [NSData dataWithContentsOfFile:[self testJPEGPath]];