* 'master' of https://github.com/rs/SDWebImage:
Add protect to some Core Graphics methods
Change all UIImage init method to alloc instead of autorelease to immediately release it after usage
Add a option SDWebImageFromCacheOnly to load the image from cache only and prevent network
Update the test for custom operation interface
Use synchronized instead of semaphore in SDWebImageDownloader to make it more easy to understand :)
Use a lock instead of barrier queue to avoid dispatch_sync blocking the main queue on race condition
* 'master' of https://github.com/rs/SDWebImage:
Update the test and description to make it more clear
Fix the issue that `setAnimationImagesWithURLs` weak reference may dealloc before the animated images was set
Fix the strange file permissions issue
Add the SDImageCacheQueryMemoryOnly to specify query memory only
Update the cache options name to make it more clear
Added missing param in storeImage examples
Add a NSProgress property represent the image loading progress, this allow user add KVO on it for complicated logic
* 'master' of https://github.com/rs/SDWebImage:
Adopt the current requirement, change ImageIO coder's canDeocdeFromHEIC to actual implementation
Fix Clang Static Analyzer warning for number nil check from Xcode 9.2
* 'master' of https://github.com/rs/SDWebImage: (25 commits)
When store image with no data for SDImageCache, check whether it contains alpha to use PNG or JPEG format
Fix the way remove all elements from pointer array
Remove some unused code, fix typo, update the comments
Use a weak pointerArray to store the operations for sd_setAnimationImagesWithURLs, avoid extra retain of operation instance
Use a copy-weak maptable for operations stored in UIView(WebCacheOperation) category to avoid retain of operation, and also use lock to keep thread-safe
Fix progressive WebP decoding by creating data provider with actual data size
Add a SDWebImageExternalCustomManagerKey context arguments to allow user to custom image manager for UIView category to avoid build from scratch
Check the group instance before calling group leave
Remove the out-dated compatible code for non-ARC
Update the comments
Allow custom SDWebImageDownloaderOperation to handle HTTP redirect
Update the comments for that SDWebImageInternalSetImageGroupKey key
Fix potential thread-safe problem in SDWebImagePrefetcher by keeping all access through prefetcher queue and retain the local URLs firstly
Update the comments and remove the unnecessary main queue check
Follow Apple doc and remove that manual calculation of byte alignment to make it more universal for different architecture device
Change prefetchURLs from nonatomic to atomic to avoid multi-thread access crash
capture currentURL instead of using index to access to avoid race condition
Grab the poster image instead of image itself to avoid an UIAnimatedImage been set
Update the documents
Update tests to invalidate session after usage
...
- the problems: some tests were just poorly written, using async calls but not properly setting async expectations. Those were generating undefined behaviour (not clear if/when those callbacks would be executed).
- also, we wanted to call `clearAllCaches` before every test, but since some methods there are async, this doesn't work with the way `setUp` was designed. So basically sometimes before a test we could clear the cache but sometimes not, or even the clear could come while running the test which was worst
- decided to fix this by making sure after every test that we manually clear what we have added.
- open the decoding/encoding procedures to the users
- switch from hardcoded decoding/encoding to pluginable decoders/encoders (builtin + user created)
- `SDWebImageCodersManager` is a singleton holding an array of `SDImageCoder` (protocol). Even though a singleton is not necesarily a good pattern, in this case it eliminates dealing with passing this array around
- uses a priority queue behind scenes, which means the latest added coders have priority.
- the priority is crucial when encoding/decoding something, we go through the list and ask each coder if they can handle the current data (see `canDecodeFromData:`, `canEncodeToFormat:`, `canIncrementallyDecodeFromData:`)
- each coder must conform to this protocol `SDImageCoder` describing all the required behavior for a coder
- we provide 3 built-in coders: `SDWebImageImageIOCoder` (for JPEG, PNG, TIFF), `SDWebImageGIFCoder` (for GIF), `SDWebImageWebPCoder` (for WebP and animated WebP)
- the user of SDWebImage can create custom coders by conforming to `SDImageCoder` and adding the coders to `SDWebImageCodersManager`. See `addCoder:` or `removeCoder:` or `coders` getter to get the array
- in order to preserve backwards compatibility, the UIImage categories were preserved, calling the new coders APIs described above
- exposing new `- (void)storeImageDataToDisk:(NSData *)imageData
forKey:(NSString *)key` function on SDImageCache
- added unit tests for this new API
- added file extension to kImageTestKey to ensure cache path is valid
for creating NSData
Unable to test sync call to diskImageExistsWithKey, hoped due to problems with the file manager and the test bundle being different from the main bundle