Commit Graph

1339 Commits

Author SHA1 Message Date
DreamPiggy 6e79ef51f0 Fix a race condition during progressive animation load in SDAnimatedImageView.
When the coder was updated, currentData may not be the same instance as previousdData. We should check the that current data is appended by previous data
2018-08-10 13:19:27 +08:00
zhongwuzw 3a22bcff58 Fix cache migration when dstPath intermediate directories not exist 2018-08-10 09:00:34 +08:00
Bogdan Poplauschi 802e19b23d
Merge pull request #2426 from zhongwuzw/remove-notification-dispatch
Make download receive response notification only dispatch to specific observer
2018-08-09 17:41:58 +03:00
zhongwuzw 9a63520115 Remove NS_DESIGNATED_INITIALIZER macro 2018-08-09 20:43:35 +08:00
zhongwuzw 22a8c43bca Put download token init internal 2018-08-09 17:21:24 +08:00
zhongwuzw 65f72743cc Merge branch '5.x' into replace-valueforkey 2018-08-09 15:41:29 +08:00
zhongwuzw ab5b5677b2 Remove setter of downloadOperation 2018-08-09 14:59:04 +08:00
Bogdan Poplauschi 83b5d22a56
Merge pull request #2417 from dreampiggy/feature_disk_cache_migration_from_4.x
Feature disk cache migration from 4.x
2018-08-08 12:47:20 +03:00
Bogdan Poplauschi 205e376388
Merge pull request #2409 from zhongwuzw/add-default-user-agent
Add default HTTP User-Agent for specific system
2018-08-08 12:42:07 +03:00
zhongwuzw 8cfda3dce9 Make download receive response notification only dispatch to specific observer 2018-08-08 15:36:57 +08:00
DreamPiggy 7ddb75710c Add SDImageFormatHEIF represent mif1 && msf1 brands
Fix the current hard-coded system version checking with Image/IO source uttypes checking
2018-08-06 17:53:24 +08:00
zhongwuzw 36cd96acce Add user-agent for tv-os 2018-08-06 14:38:35 +08:00
DreamPiggy 42caecf27b Fix that `shouldUseWeakMemoryCache` code was lost during merge conflict 2018-08-06 11:18:00 +08:00
Bogdan Poplauschi 1d4823eb48 Merge pull request #2415 from dreampiggy/feature_minimum_progress_interval
Feature minimum progress interval
2018-08-04 19:11:04 +03:00
DreamPiggy 3863264a13 Improve the code robustness of disk cache migrate 2018-08-03 22:06:19 +08:00
DreamPiggy d9d0b7d4bf Add the feature, to migrate the disk cache from 4.x version to the new location of cache path. 2018-08-03 17:32:04 +08:00
DreamPiggy 8b7e88de50 Merge branch 'master' of https://github.com/rs/SDWebImage into 5.x
# Conflicts:
#	SDWebImage/FLAnimatedImage/FLAnimatedImageView+WebCache.m
#	SDWebImage/SDWebImageDownloader.h
#	SDWebImage/SDWebImageDownloader.m
#	SDWebImage/SDWebImageDownloaderOperation.h
#	SDWebImage/UIView+WebCache.m
#	Tests/Tests/SDWebImageDownloaderTests.m
2018-08-02 18:42:21 +08:00
Bogdan Poplauschi 676a4b53b7 Merge pull request #2336 from gukemanbu/xucg
remove addProgressCallback, add createDownloaderOperationWithUrl
2018-08-02 11:25:51 +03:00
DreamPiggy 67e0df75c6 Add one feature, to allow user to limit the progress interval and reduce the frequency of progress callback
Also fix that progressive decoding should stop when all image data is downloaded
2018-08-02 13:18:04 +08:00
DreamPiggy 892267af74 Fix that downloader options about image decoding is not correctly set 2018-08-02 11:07:53 +08:00
DreamPiggy cb8879f56a Fix that using `NS_TYPED_ENUM` on `SDImageFormat` cause the existing Swift API naming changed 2018-08-01 20:52:50 +08:00
zhongwuzw c77310bb5d Add default HTTP User-Agent for specific system 2018-07-31 16:29:39 +08:00
Bogdan Poplauschi 8f187477c6
Merge pull request #2406 from dreampiggy/fix_gif_rotation_after_exif_image
Fix the bug when FLAnimatedImageView firstly show one EXIF rotation JPEG `UIImage`, later animated GIF `FLAnimatedImage` will also be rotated
2018-07-29 21:39:46 +03:00
DreamPiggy 31896ff086 Fix the bug when FLAnimatedImageView firstly show one EXIF rotation JPEG `UIImage`, later animated GIF `FLAnimatedImage` will also be rotated
We help FLAnimatedImage framework to fix their issue :)
2018-07-27 22:24:31 +08:00
DreamPiggy ef3123984f Add SDImageCoderWebImageContext coder option, which allow custom coder plugin, to receive the context option from top-level API (Cache/Downloader/View Category) 2018-07-26 16:44:40 +08:00
DreamPiggy 919751f2de Change SDImageFormat to use `NS_TYPED_EXTENSIBLE_ENUM` instead of fixed enum, to allow custom coder plugin extern the define (#2400)
* Change SDImageFormat to use `NS_TYPED_EXTENSIBLE_ENUM` instead of fixed enum, to allow custom coder plugin extern the define

* Update the comment and indent about `SDImageFormat`
2018-07-24 14:11:57 +08:00
zhongwuzw 2b7b5f5fa2 Use NSDictionary syntatic sugar 2018-07-24 13:05:12 +08:00
zhongwuzw 532a4d8229 Replace setValue:forKey with syntactic sugar 2018-07-24 10:09:57 +08:00
zhongwuzw 05889b6b9c Replace valueForKey with objectForKey when access NSDictionary 2018-07-21 23:44:06 +08:00
zhongwuzw 16a1960018 Remove redundancy protocol declaration 2018-07-20 22:12:48 +08:00
zhongwuzw 43edf04ba0 Replace SDWebImageDownloaderOperation with NSOperation<SDWebImageDownloaderOperationInterface> to make generic 2018-07-20 22:08:06 +08:00
DreamPiggy 6398eedce8 Rename `sd_UTTypeFromSDImageFormat` to `sd_UTTypeFromImageFormat` 2018-07-19 01:44:48 +08:00
DreamPiggy d5b60c6b39 Merge branch 'master' of https://github.com/rs/SDWebImage into 5.x
# Conflicts:
#	CHANGELOG.md
#	SDWebImage.podspec
#	SDWebImage/FLAnimatedImage/FLAnimatedImageView+WebCache.m
#	SDWebImage/SDImageCache.h
#	SDWebImage/SDWebImageCoderHelper.m
#	SDWebImage/SDWebImageCodersManager.m
#	SDWebImage/SDWebImageCompat.m
#	SDWebImage/SDWebImageGIFCoder.m
#	SDWebImage/SDWebImageImageIOCoder.m
#	SDWebImage/SDWebImageWebPCoder.m
#	SDWebImage/UIImage+MultiFormat.h
#	SDWebImage/UIImage+MultiFormat.m
#	SDWebImage/UIView+WebCache.h
#	SDWebImage/UIView+WebCache.m
#	WebImage/Info.plist
2018-07-19 00:56:43 +08:00
Bogdan Poplauschi d7c665068c
Merge pull request #2394 from zhongwuzw/fix-cfstringref-ownership-for-master
Replace __bridge_transfer with __bridge when convert from CFStringRef to NSString
2018-07-18 18:35:45 +03:00
zhongwuzw 61800a8e31 Replace __bridge_transfer with __bridge when convert from CFStringRef to NSString 2018-07-18 23:14:40 +08:00
zhongwuzw 593feb664c Revert operation remove logic 2018-07-18 23:07:25 +08:00
zhongwuzw 7f1440bc96 Merge commit '98a2d9a3b4dd7ec47072e726a5d848b7a3bcc2f1' into fix-nullable 2018-07-18 23:03:13 +08:00
DreamPiggy 3863052094 Fix that FLAnimatedImageView+WebCache display behavior for GIF images and other images format
Fix FLAnimatedImageView will dispatch the completion block into next runloop even for non-GIF image
Fix FLAnimatedImageView may not show animation even when the disk image data is GIF image
2018-07-18 17:42:16 +08:00
zhongwuzw b291351754 Replace __bridge_transfer with __bridge when convert from CFStringRef to NSString 2018-07-18 16:40:33 +08:00
Bogdan Poplauschi f0f4b7d190
Merge pull request #2391 from dreampiggy/feature_disk_cache_data
Add one sync API for SDImageCache to directly get the image data from disk instead of image instance
2018-07-18 11:16:07 +03:00
DreamPiggy 5e52585944 Add one sync API for SDImageCache to directly get the image data from disk instead of image instance 2018-07-18 13:06:21 +08:00
DreamPiggy bb41dbc046 Keep the information about image's original compressed format, for API which only contains image but not image data to process extra logic 2018-07-18 12:57:36 +08:00
zhongwuzw 820f13ec93 Fix nullable key when get image load operation 2018-07-17 17:51:23 +08:00
Bogdan Poplauschi 957de6d70f Merge branch 'master' into 5.x 2018-07-17 11:10:12 +03:00
Bogdan Poplauschi 025af81bdf
Merge pull request #2385 from dreampiggy/project_move_FLAnimatedImage
Remove all FLAnimatedImage from the Core SDWebImage repo. Move the code to SDWebImageFLPlugin repo
2018-07-16 12:33:32 +03:00
zhongwuzw 9ec7aa4219 Fix nullable key when cancel image load operation 2018-07-13 22:43:00 +08:00
DreamPiggy 982ade8824 Remove all FLAnimatedImage from the Core SDWebImage repo. Move the code to SDWebImageFLPlugin repo 2018-07-13 22:17:02 +08:00
Bogdan Poplauschi f8fe886334 Instead of defining `LOCK` and `UNLOCK` macros in each file, moved them to the `SDWebImageCompat.h`. Also, split into `LOCK` and `LOCKBLOCK` 2018-07-12 21:10:28 +03:00
zhongwuzw d908a1cc35 Replace runningOperations of SDWebImageManager from Array to Set 2018-07-12 22:05:09 +08:00
DreamPiggy 0108475578 Merge branch 'master' of https://github.com/rs/SDWebImage into 5.x
# Conflicts:
#	SDWebImage/SDImageCache.m
#	SDWebImage/SDImageCacheConfig.h
#	SDWebImage/SDImageCacheConfig.m
2018-07-12 19:33:18 +08:00
DreamPiggy 98c28a4419 Update the comments and fix typo 2018-07-12 01:49:32 +08:00
DreamPiggy 233caefec8 Add cache control for FLAniamtedImage, this allow user to disable memory cache for associated FLAnimatedImage instance 2018-07-12 01:40:56 +08:00
DreamPiggy 76215d7717
Merge pull request #2376 from zhongwuzw/fix-race-condition 2018-07-11 12:05:10 +08:00
zhongwuzw 28eb1b4b5c Fix crash when assign request property of SDWebImageDownloadToken 2018-07-09 16:32:47 +08:00
gukemanbu 23388717bc
Merge branch 'master' into xucg 2018-07-09 01:25:32 +00:00
DreamPiggy 8dc39b17fe
Merge pull request #2371 from zhongwuzw/remove-unnecessary-copy
Remove unnecessary copy
2018-07-08 22:15:55 +08:00
zhongwuzw ab86065f38 Fix image prefetcher completion logical handler 2018-07-08 14:26:38 +08:00
DreamPiggy bfa940352f Add option to enable or disable weak memory cache for SDImageCache 2018-07-07 12:50:42 +08:00
DreamPiggy dd6e4a1d2e Follow App Store submit rule, upgrade the min Xcode version to Xcode 9.0
Using `@available` and `API_AVAILABLE` to check API availability
2018-07-06 12:57:43 +08:00
DreamPiggy 3dad550180
Merge pull request #2370 from zhongwuzw/fix_nullable
Fix HTTP Header key field nullable
2018-07-06 00:00:47 +08:00
zhongwuzw bb55b6eb72 Fix typo 2018-07-05 22:24:25 +08:00
zhongwuzw a2d65b61e1 Fix race condition of SDWebImagePrefetcher's completion handler 2018-07-05 22:03:35 +08:00
zhongwuzw 6d295c2a83 Fix typo 2018-07-04 15:49:39 +08:00
zhongwuzw 572a074161 Fix SDImageLoaderManager that only load image when loader can handle url 2018-07-04 15:19:12 +08:00
zhongwuzw c294bebec1 update available macro 2018-07-04 14:57:20 +08:00
zhongwuzw d84e656d05 Remove unnecessary copy 2018-07-04 12:22:33 +08:00
zhongwuzw 6674b9f711 Fix HTTP Header key field nullable 2018-07-03 21:18:02 +08:00
DreamPiggy a82a4e15b2 Renaming UIImage+WebCache to the correct naming UIImage+Metadata, make clear of the category usage 2018-06-25 13:52:46 +08:00
DreamPiggy 4dbb15712b Fix that UIImage+Transform on macOS to use BGRA8888 instead of ARGB8888, as Apple's doc 2018-06-23 23:06:48 +08:00
DreamPiggy e5716db4d0 Add one convenient method to pass context arg without completed block for all View Category 2018-06-23 15:04:12 +08:00
Paul Lavoine 268d6d607a Refactor cacheClearBy property name 2018-06-23 08:58:06 +02:00
DreamPiggy ab75235b3b
Merge pull request #2360 from dreampiggy/feature_manager_store_cache_option
Add the `SDWebImageContextStoreCacheType` context option to specify target cache type when the image is downloaded by manager and will store to cache
2018-06-23 13:45:38 +08:00
DreamPiggy abf9031818
Merge pull request #2361 from dreampiggy/refactor_uiimage_multiformat
Refactor the UIImage+MultiFormat and GIF/WebP category
2018-06-23 13:34:56 +08:00
Paul Lavoine 5408da630c Enable to change clear cache option 2018-06-18 15:56:17 +02:00
DreamPiggy e533a3da80 Refactor the UIImage+MultiFormat and GIF/WebP category. Simplify the usage and remove the extra method which is not used so common. 2018-06-16 20:05:54 +08:00
DreamPiggy a57e0f7e13 fix that SDImageCache does not use transformed key to query cache when provide a transformer 2018-06-15 23:20:45 +08:00
DreamPiggy e5bee68164 Add the `SDWebImageContextStoreCacheType` context option to specify detailed cache when the image is downloaded by manager and will store to cache.
This replace the previous `SDWebImageCacheMemoryOnly` option, which is not so accurate and lack of detail control for cache behavior.
2018-06-15 23:13:59 +08:00
DreamPiggy 0437759c80 Fix that WebP (including Animated WebP) decoding issue on iOS 12. Using the correct bitmapInfo to avoid `CGImageCreate` failed when the WebP image contains no alpha channel 2018-06-07 11:08:52 +08:00
DreamPiggy 4eb13bf2a1 Remove the header dependency of SDWebImageManager of SDWebImageDownloader. Use SDImageLoaderProgressBlock instead of SDWebImageDownloadProgressBlock 2018-06-06 14:41:44 +08:00
DreamPiggy f96c94ef7d Renaming all `SDWebImageLoader` -> `SDImageLoader` 2018-06-06 14:41:44 +08:00
DreamPiggy 7571f8962b Merge branch 'master' of https://github.com/rs/SDWebImage into 5.x
# Conflicts:
#	Examples/SDWebImage Watch Demo Extension/InterfaceController.m
#	SDWebImage/SDWebImageCompat.h
#	SDWebImage/SDWebImageDownloader.m
#	SDWebImage/SDWebImageManager.m
#	SDWebImage/UIView+WebCache.h
#	SDWebImage/UIView+WebCache.m
2018-06-06 14:38:38 +08:00
DreamPiggy 48acb8e423 Fix that the downloader operation may not call the completion block in race condition, which the operation we get is finished but not been removed from the operation array. 2018-06-04 20:20:28 +08:00
DreamPiggy 799ef18c06 Add the support for watchOS to use View Category method (sd_setImageWithURL:) on WKInterfaceImage 2018-05-31 11:32:52 +08:00
DreamPiggy dfe010273a
Merge pull request #2323 from dreampiggy/feature_FLAnimatedImageVIewOptimizationLevel
Add optimalFrameCacheSize && predrawingEnabled options for FLAnimatedImage
2018-05-30 21:58:55 +08:00
DreamPiggy bf3c0b42dc A little improvement for image progress code for UIView+WebCache.m 2018-05-30 21:42:40 +08:00
DreamPiggy 6661575432
Merge pull request #2340 from hulizhen/optimization/replace-synchronized
Replace @synchronized with dispatch_semaphore_t in SDWebImageManager
2018-05-30 15:28:20 +08:00
Lizhen Hu 3ee1b60678 Revert replacement of @synchronized in SDWebImageCombinedOperation 2018-05-30 14:57:41 +08:00
Lizhen Hu 0b8207b1d2 Refactor in SDWebImageManager 2018-05-30 13:58:47 +08:00
Lizhen Hu 1aced8aa62 Remove unused header file 2018-05-28 23:26:09 +08:00
Lizhen Hu 09020fac87 Replace @synchronized lock with dispatch_semaphore lock for SDWebImageCombinedOperation 2018-05-28 23:14:12 +08:00
Lizhen Hu 7dc38751e9 Use non-recursive lock for runningOperations in SDWebImageManager 2018-05-28 23:10:40 +08:00
Lizhen Hu a6e3907f26 Replace @synchronized with pthread_mutex_t & dispatch_semaphore_t in SDWebImageManager 2018-05-28 13:35:19 +08:00
xucg 6ab801b780 remove addProgressCallback, add createDownloaderOperationWithUrl 2018-05-24 16:50:50 +08:00
DreamPiggy 994bf0fe38 Add the support for watchOS to use View Category method (sd_setImageWithURL:) on WKInterfaceImage 2018-05-24 03:08:56 +08:00
DreamPiggy 522e729094
Merge pull request #2330 from dreampiggy/bugfix_watchOS_animated_image
Fix that watchOS UIImage+WebCache does not mark as available and cause crash
2018-05-24 02:06:33 +08:00
DreamPiggy 0471861d23 Fix that watchOS UIImage+WebCache does not mark as available and cause crash 2018-05-24 01:37:11 +08:00
DreamPiggy 6d7d89cd3b
Merge branch '5.x' into fix-safe-async 2018-05-22 20:43:57 +08:00
zhongwuzw 7515f06b44 Minor optimize for dispatch_queue_async_safe 2018-05-22 20:34:41 +08:00
zhongwuzw 7d170d47d9 Remove dispatch_queue_async_safe && optimize dispatch_main_async_safe 2018-05-21 17:51:07 +08:00
DreamPiggy a34133b864 Fix the progressive decoding bug on macOS. Including image orientation & SDAnimatedimageView 2018-05-21 15:50:06 +08:00
DreamPiggy 0a0bdc92db Merge branch 'master' of https://github.com/rs/SDWebImage into 5.x
# Conflicts:
#	SDWebImage/SDWebImageImageIOCoder.m
#	SDWebImage/SDWebImageWebPCoder.m
#	Tests/Tests/SDImageCoderTests.m
2018-05-17 11:24:47 +08:00
DreamPiggy e9527b393a Add optimalFrameCacheSize && predrawingEnabled options for FLAnimatedImage. It makes users to set optimal frame cache size of FLAnimatedImage after image load. 2018-05-16 15:35:55 +08:00
DreamPiggy 55584b7e91 Remove one unused header 2018-05-10 14:49:48 +08:00
DreamPiggy 5df8f2a8b9 Fix image cache options issue, remove the unused `SDImageCacheTransformAnimatedImage` 2018-05-10 14:49:15 +08:00
DreamPiggy 18ee2352b0 Fix WebP Encoding only works for RGBA8888 CGImage but not other color mode.
Detect the current CGImage color mode, covert the all other case to RGB888/RGBA8888 using vImage
2018-05-10 14:22:51 +08:00
Bogdan Poplauschi 12fe445498
Merge pull request #2315 from dreampiggy/improvement_image_transition_user_interaction
Add `UIViewAnimationOptionAllowUserInteraction` as default options for convenient image transition
2018-05-09 12:50:53 +03:00
Bogdan Poplauschi df69e8c492
Merge pull request #2311 from dreampiggy/bugfix_WebP_encode_color_mode
Bugfix webp encode color mode
2018-05-09 12:47:07 +03:00
DreamPiggy e9c824c95f
Merge pull request #2314 from dreampiggy/fix_duplicated_force_decode_imageIO
Remove the duplicated process to force decode (draw on bitmap context) in Image/IO's progressive decoding.
2018-05-07 19:41:40 +08:00
DreamPiggy ec37a48ba3 Add `UIViewAnimationOptionAllowUserInteraction` as default options for convenient image transition 2018-05-04 16:48:52 +08:00
DreamPiggy ab854e3575 Remove the duplicated process to force decode (draw on bitmap context) in Image/IO's progressive decoding. 2018-05-04 16:38:17 +08:00
DreamPiggy c6fa6e31fb Remove the extra calculation of image orientation for ImageIO coder 2018-05-04 16:30:39 +08:00
DreamPiggy d7ceb2764b Add options to specify query cache sync/async behavior. This can help for web cache manager to avoid flashing during cell reusing. 2018-05-03 21:00:20 +08:00
DreamPiggy 9bf79ab85b Fix WebP Encoding only works for RGBA8888 CGImage but not other color mode.
Detect the current CGImage color mode, covert the all other case to RGB888/RGBA8888 using vImage
2018-05-02 23:43:27 +08:00
Bogdan Poplauschi ebfe2cedc2 Merge pull request #2306 from dreampiggy/renaming_coder_protocol_and_coders
Renaming coder protocol and coders
2018-04-26 19:08:34 +03:00
Bogdan Poplauschi 18ecf8f96e Merge pull request #2305 from dreampiggy/renaming_coder_helper
Renaming SDWebImageFrame & SDWebImageCoderHelper
2018-04-26 18:54:50 +03:00
Bogdan Poplauschi 5bedca7473
Merge pull request #2304 from dreampiggy/renaming_image_transformer
Renaming image transformer
2018-04-26 18:49:52 +03:00
DreamPiggy 0423cc2cf0 Update the test for image coder renaming 2018-04-26 23:21:26 +08:00
DreamPiggy 6e5a0ea5f0 Rename Image/IO GIF APNG WebP coders to without `Web` prefix.
Rename `SDWebImageCodersManager` to `SDImageCodersManager`
2018-04-26 23:12:54 +08:00
DreamPiggy 15bceab71c Rename `SDWebImageCoder` to `SDImageCoder`.
Rename `SDWebImageProgressiveCoder` to `SDProgressiveImageCoder`
Rename `SDWebImageAnimatedCoder` to `SDAnimatedImageCoder`
2018-04-26 23:05:13 +08:00
DreamPiggy 9ee3dac978 Renaming `SDWebImageFrame` -> `SDImageFrame`. `SDWebImageCoderHelper` -> `SDImageCoderHelper` 2018-04-26 23:04:20 +08:00
DreamPiggy e862ea1b8e Rename all `SDWebImageTransformer` to `SDImageTransformer` 2018-04-26 23:03:44 +08:00
DreamPiggy 425d78de12 Renaming the `downloadOperation` to `loaderOperation` in `SDWebImageCombinedOperation` 2018-04-26 21:48:34 +08:00
DreamPiggy e9cf356e57 Renaming `SDWebImageProgressiveDownload` to `SDWebImageProgressiveLoad`. Which is more suitable for custom loader which also support progressive image loading. (No need to be download) 2018-04-26 21:42:25 +08:00
DreamPiggy 8f49d753b4 Remove the duplicated process to force decode (draw on bitmap context) in Image/IO's progressive decoding.
This is the bug in early version of Image/IO framework, but now it's already been fixed and duplicated process impact performance
2018-04-25 15:54:17 +08:00
DreamPiggy 65537c4983 Remove the check for URLProtocol in custom loader to avoid crash on iOS 8. Let URLSession itself or download operation to parse the result. 2018-04-25 14:21:38 +08:00
DreamPiggy 0832da8d7c Avoid duplicated force decode for progressive WebP images 2018-04-25 13:39:06 +08:00
DreamPiggy 072b832375 Fix the issue for progressive decoding that do not parse the correct animated image scale. Update all coders 2018-04-25 12:59:44 +08:00
DreamPiggy a22a0e25f7 Merge branch 'master' of https://github.com/rs/SDWebImage into 5.x
# Conflicts:
#	SDWebImage/SDImageCache.h
2018-04-25 10:56:51 +08:00
DreamPiggy 22e532c9e3 Fix function storeImageDataToDisk description 2018-04-24 21:32:26 +08:00
Bogdan Poplauschi 778322daf9
Merge pull request #2296 from dreampiggy/refactor_manager_logic
Refactor manager logic - Also suppoort ignore cache query
2018-04-24 15:39:17 +03:00
Bogdan Poplauschi e8ce9e89c5
Merge pull request #2299 from dreampiggy/feature_cache_namespace_prefix
Add the ability to custom the cache namespace prefix
2018-04-24 08:57:43 +03:00
plokijuhhb 745dc38986
Fix function storeImageDataToDisk description
New Pull Request Checklist

 I have read and understood the CONTRIBUTING guide

 I have read the Documentation

 I have searched for a similar pull request in the project and found none

 I have updated this branch with the latest master to avoid conflicts (via merge from master or rebase)

 I have added the required tests to prove the fix/feature I am adding

 I have updated the documentation (if necessary)

 I have run the tests and they pass

 I have run the lint and it passes (pod lib lint)

This merge request fixes / reffers to the following issues: ...

Pull Request Description

####Description
There are some problems in this description

Or using marco like SDWebImageCompat avoid deadlocks

#ifndef dispatch_queue_sync_safe
#define dispatch_queue_sync_safe(queue, block)\
if (strcmp(dispatch_queue_get_label(DISPATCH_CURRENT_QUEUE_LABEL), dispatch_queue_get_label(queue)) == 0) {\
block();\
} else {\
dispatch_sync(queue, block);\
}
#endif
2018-04-24 00:33:54 +08:00
DreamPiggy cfd68422dc Refactor current manager's internal implementation for that `loadImageWithURL:`. Separate to 3 parts (context preprocess, cache process, download process). Also introduce `SDWebImageFromLoaderOnly` feature to ignore cache at all
This is useful for some custom image loader where user does not need memory cache at all.
2018-04-21 15:12:17 +08:00
DreamPiggy bf85c53b77 Remove the unused header files in download operation 2018-04-21 14:33:02 +08:00
DreamPiggy 8269a0cd8e Add the ability to custom the cache namespace prefix. Which allow user to specify the correct namespace prefix by their own 2018-04-21 14:00:46 +08:00
DreamPiggy 4b69f49c13 Rename the progressive download helper function to using `operation` instead of pass a progressive coder to make the logic more suitable for the caller 2018-04-21 10:53:23 +08:00
DreamPiggy be8fce5ddb Fix the download operation to specify correct error code for bad image data 2018-04-20 11:05:53 +08:00
DreamPiggy 70d9d31c0f Fix the wrong options issue 2018-04-20 11:05:35 +08:00
Bogdan Poplauschi efb764d587
Merge pull request #2265 from dreampiggy/improvement_module_framework
Improvement module framework
2018-04-19 14:13:44 +03:00
DreamPiggy 8ed4dcb884 Fix the warning of high version API on macOS 2018-04-19 17:51:55 +08:00
DreamPiggy f81480189d Add modulemap files for SDWebImage to support modular framework, move the WebP & GIF into subdirectory to make Podspec works 2018-04-19 17:25:39 +08:00
DreamPiggy 31b3726439 Merge branch 'master' of https://github.com/rs/SDWebImage into 5.x
# Conflicts:
#	SDWebImage/SDWebImageCodersManager.m
2018-04-19 17:04:23 +08:00
Bogdan Poplauschi af0eaccbc5 Merge pull request #2292 from dreampiggy/refactor_cache_webcache_protocol
Fix the custom cache protocol naming
2018-04-19 10:39:39 +03:00
Bogdan Poplauschi eded5f026c Merge pull request #2293 from dreampiggy/refactor_naming_NSImge_category
Renaming the NSImage category naming to `NSImage+Compatibility`
2018-04-19 10:26:51 +03:00
Bogdan Poplauschi 8154d16bb2
Merge pull request #2274 from dreampiggy/fix_coders_array
Fix the thread-safe issue for coders manager.
2018-04-19 08:34:43 +03:00
DreamPiggy 7cf58ad7c5 Renaming the NSImage category naming to `NSImage+Compatibility`, because it's only used for Cross-platform compatibility code. `Additions` is too wide 2018-04-18 21:14:34 +08:00
DreamPiggy d5074429f0 Add tests for custom loader protocol, using a test loader to specify loader function 2018-04-18 20:46:00 +08:00
DreamPiggy 60759f812a Refactor to only use one publish protocol for custom loader. Renaming image downloader description to loader 2018-04-18 20:46:00 +08:00
DreamPiggy 8292c0c1e9 Update the loader protocol to refactor the common image decoding process. 2018-04-18 20:26:14 +08:00
DreamPiggy 57db312cc5 Add `SDWebImageLoader` protocol for custom image loader. Also introduce the `SDWebImageLoadersManager` to manage multiple loaders with priority 2018-04-18 20:26:14 +08:00
DreamPiggy a6bdba724e Fix all cache test 2018-04-18 19:24:23 +08:00
DreamPiggy 734c6821d5 Rename the cache protocol to `SDImageCache` protocol 2018-04-18 19:24:23 +08:00
DreamPiggy bee5425078 Rename the caches manager without `Web` prefix 2018-04-18 19:24:22 +08:00
Bogdan Poplauschi 5426a720f7
Merge pull request #2278 from dreampiggy/refactor_cache_webcache_protocol
Refactor cache - Support custom web cache
2018-04-18 14:06:50 +03:00
Bogdan Poplauschi 00f9f3a597
Merge pull request #2290 from dreampiggy/refactor_error_code
Refactor error code
2018-04-18 10:44:07 +03:00
Bogdan Poplauschi 6e5b9634a8
Merge pull request #2287 from dreampiggy/fix_default_config_readonly
Fix the default download config & cache config to readonly
2018-04-18 10:41:43 +03:00
DreamPiggy 5a32da7953 Move the complicated built-in decode process into a global function to allow user who custom web cache use it 2018-04-18 14:59:34 +08:00
DreamPiggy 632a2bb110 Rename all the image cache block naming with the unite naming (Prefix `SDImageCache`) 2018-04-18 14:40:56 +08:00
DreamPiggy 1220f73507 Expose the sync version of remove API 2018-04-18 14:40:56 +08:00
DreamPiggy 9f770b6c19 Refactor to support custom image cache used for web manager. Supports caches manager with multiple caches and op policy 2018-04-18 14:40:56 +08:00
DreamPiggy f7af36f3bd Merge branch 'master' of https://github.com/rs/SDWebImage into 5.x
# Conflicts:
#	SDWebImage/SDImageCache.h
#	SDWebImage/SDImageCache.m
#	SDWebImage/SDWebImageManager.m
2018-04-18 14:37:15 +08:00
DreamPiggy 60d58ef977 Refactor all current custom error in SDWebImageErrorDomain with error code. Also using NS_ERROR_ENUM to provide better Swift API 2018-04-18 13:26:20 +08:00
DreamPiggy 77426d127f Fix the default download config & cache config to readonly. You can modify the property of config, but not the override the default config instance itself. 2018-04-17 19:28:41 +08:00
Bogdan Poplauschi 1bc4662bde Merge pull request #2282 from dreampiggy/refactor_memory_cache_disk_cache
Refactor cache - Support custom memory cache & disk cache
2018-04-17 12:14:06 +03:00
Bogdan Poplauschi 9711cdbcd5
Merge pull request #2280 from dreampiggy/refactor_custom_cache_serializer_headers_filter
Refactor custom cache serializer & headers filter for request level
2018-04-17 11:45:38 +03:00
DreamPiggy d9c93e1a86 Revert "Revert "Fix two warnings about losing precision in comparison""
This reverts commit d19311e08c.
2018-04-17 13:01:10 +08:00
DreamPiggy dd2e71c99d Add support for SDAnimatedImage imageNamed:bundle: for macOS, enable SDAnimatedImageTest for macOS 2018-04-17 12:03:24 +08:00
DreamPiggy d19311e08c Revert "Fix two warnings about losing precision in comparison"
This reverts commit a710bc5472.
2018-04-17 11:27:50 +08:00
DreamPiggy 56fea371b0 Fix compile issue 2018-04-17 11:10:53 +08:00
DreamPiggy a8639f9fd0 Use `NSTimeInterval` for age property, because it's more proper represent seconds 2018-04-17 11:09:56 +08:00
DreamPiggy 62058d209d Add memory cache and disk cache protocol, make our image cache just like a wrapper to call the disk cache implementation 2018-04-17 11:09:56 +08:00
DreamPiggy 781c079a3a Use `SDWebImageAvoidDecodeImage` to allow user to control force decode feature for individual image request. Replace all the central control for `decompressImages` 2018-04-16 01:12:09 +08:00
DreamPiggy 5665b6fdf2 Fix the issue about scale factor using `initWithCGImage:size` macOS, we should always use `NSBitmapImageRep` to keep cross-platform compatible 2018-04-15 13:49:42 +08:00
DreamPiggy d02c8d15e2 Use the scale category from `NSImage+Addtions` instead of manual created property for `SDAnimatedImage` on macOS 2018-04-15 13:13:51 +08:00
DreamPiggy 94b67bf3b0 Fix the NSSecureCoding implementation for SDAnimatedImage 2018-04-15 01:36:10 +08:00
DreamPiggy fcfca57463 Add limitBytes arg for UIImage+ForceDecode category 2018-04-14 22:33:19 +08:00
DreamPiggy 0dfeebefeb Add `SDImageCacheScaleDownLargeImages` to allow cache to scale down large images if need 2018-04-14 22:14:59 +08:00
DreamPiggy 3d7896f663 Adopt the current cache key filter and cache serializer to support using in context options. Using a protocol based object store block instead block itself. 2018-04-14 18:18:45 +08:00
DreamPiggy 7272cf78e5 Fix the silly mistake that view category internal completion block call swapped cacheType and finished arg 2018-04-14 16:59:34 +08:00
DreamPiggy e1d96e7812 Revert "Merge pull request #1898 from walkline/master into 5.x" 2018-04-13 16:48:15 +08:00
DreamPiggy 25b61bb5ae Refactor the cache path API. Only given the full cache path to allow user to choose to use filename or full path. And use a block instead of static array for additional cache path. 2018-04-13 11:10:14 +08:00
DreamPiggy e829637a30 Update to use scale factor instead of that firstFrameOnly, since it's not used frequently as scale 2018-04-13 02:34:52 +08:00
DreamPiggy b9773d09c0 Fix SDGetColorFromPixel ignore kCGImageAlphaOnly case 2018-04-13 02:15:18 +08:00
DreamPiggy 7701215ae0 Fix the bug that reset indicator view does not remove from super view 2018-04-13 01:17:13 +08:00
DreamPiggy dfe4a66424 Fix the thread-safe issue for coders manager. Use lock and immutable object to keep `addCoder`, `removeCoder` thread-safe. 2018-04-12 13:40:10 +08:00
DreamPiggy a710bc5472 Fix two warnings about losing precision in comparison 2018-04-12 01:19:06 +08:00
DreamPiggy d515a36337 Merge branch 'master' of https://github.com/rs/SDWebImage into 5.x
# Conflicts:
#	SDWebImage/SDWebImageImageIOCoder.m
2018-04-12 01:16:34 +08:00
DreamPiggy 2cb03773db
Merge pull request #2261 from dreampiggy/feature_request_modifier_and_response
Feature request modifier and response
2018-04-11 16:51:28 +08:00
DreamPiggy 49cecfe34a Fix that force decode not works for alpha-channel images. This should only exclude animated images. All other images should use the display alpha info based on whether contains alpha or not to force decode 2018-04-11 14:15:27 +08:00
DreamPiggy e2c99f437d Remove the extra category method for `NSBitmapImageRep`. Only use `NSImage`'s native API to manage it 2018-04-11 12:57:46 +08:00
DreamPiggy cebf72d6d5 Refactor API. Change that `imageRef` arg description to `CGImage` to match the common design pattern and make it clear to Swift user 2018-04-11 11:32:43 +08:00
DreamPiggy 7d50d61b37 Update the NSImage+Addtions to allow specify a image orientation when using `CGImage`. Update all the place we use 2018-04-10 22:51:28 +08:00
DreamPiggy acbdb8c374 Add helper method in coder helper to create decoded CGImage to specify orientation. The existing method just call with Up orientation 2018-04-10 21:19:12 +08:00
DreamPiggy b9ec481edf Remove the extra calculation of image orientation for ImageIO coder 2018-04-10 21:19:12 +08:00
DreamPiggy 0705a973be Update to import sd_isDecoded to avoid extra decode. And change exif orientation to CGImagePropertyOrientation define 2018-04-09 14:22:47 +08:00
DreamPiggy 22c293738a Update the progressive coder/ animated coder init API, which pass the options to support extensibility 2018-04-09 13:42:52 +08:00
DreamPiggy cbf8581696 Fix the scale factor issue on macOS using helper methods to match the behavior of UIKit. Also remove the unused API on NSImage category 2018-04-08 19:54:39 +08:00
DreamPiggy 1a3fb834a0 Add SDScaledImageForScaleFactor, make the API more clear. Fix the scale factor option issue 2018-04-08 00:50:19 +08:00
DreamPiggy 7a84e59eb1 Add the context option SDWebImageContextImageScaleFactor to custom a scale factor which is not based on the cache key. 2018-04-07 23:47:41 +08:00
DreamPiggy fea3a56d71 Add a SDWebImageCoderDecodeScaleFactor option to specify scale factor using for decoder. Since the scale information is not stored into image data itself, but generated from image file name & metadata. 2018-04-07 23:21:16 +08:00
DreamPiggy 55256d0091 Use a protocol instance instead of block for request modifier. This can solve the problem that Swift user is hard to grab the block back stored in dictionary. 2018-04-07 15:56:34 +08:00
DreamPiggy fa7d19c099 Update the comments and expose the token's request, which can be used for advanced usage. 2018-04-07 15:52:39 +08:00
DreamPiggy f01fe38fdd Add downloader request modifier to allow modify final HTTP request. Also open the API to allow advanced user to check cache & downloader operation. 2018-04-07 15:52:39 +08:00
DreamPiggy 01e75cfa7c Merge branch 'master' of https://github.com/rs/SDWebImage into 5.x 2018-04-06 13:45:17 +08:00
DreamPiggy 407b708b38 Add shouldIncrementalLoad in SDAnimatedImageView to choose the animation behavior for progressive looading 2018-04-05 22:10:40 +08:00
DreamPiggy 393085a9b0 Update the default downloader config to use the dispatch_once to avoid thread-safe issue 2018-04-05 18:44:38 +08:00
DreamPiggy 1d7dba33f5 Update the test about download operation, which using protocol instead of class 2018-04-05 15:25:14 +08:00
DreamPiggy 73c811dc23 Fix all code tied with SDWebImageDownloaderOperation class but not protocol, which previously relay on NSURLSession but it should not to be 2018-04-05 07:26:50 +08:00
DreamPiggy 321101fa60 Use NS_EXTENSIBLE_STRING_ENUM instead of NS_STRING_ENUM 2018-04-05 01:35:59 +08:00
DreamPiggy 6e402ce41c Add KVO for maxConcurrentDownloads to allow dynamic change 2018-04-05 00:15:53 +08:00
DreamPiggy 47aa73a436 Update the downloader token's property to match the comments 2018-04-05 00:15:53 +08:00
DreamPiggy c3892d7d08 Move all download settings into SDWebImageDownloaderConfig, make it more easy to use with clear API.
Deprecate `createNewSessionWithConfiguration`, which make downloader not sync with URLSession. If user need to specify sharedDownloader config, just modify the defaultDownloaderConfig instead.
2018-04-05 00:15:53 +08:00
DreamPiggy c21381e83b Change `isRunning` on manager from method to property 2018-04-02 22:28:58 +08:00
DreamPiggy 8236dee202 Move the context arg after the `options` arg to make Swift ABI clear. Also update all view category to support context arg. 2018-04-02 03:24:23 +08:00
DreamPiggy d751b20652 Move all the webcache options into the `SDWebImageDefine.h` files to avoid import of `SDWebImageManager.h` and include cycle. 2018-04-01 22:02:50 +08:00
DreamPiggy 0f36f97ae8 Fix the documentation issue about cacheSerializer 2018-04-01 21:54:10 +08:00
DreamPiggy f1b5e94799 Update the comments 2018-03-31 22:08:27 +08:00
DreamPiggy bc164d6369 Fix prefetcher thread-safe problem using stdatomic instead of OSAtomic. Also fix test. 2018-03-31 21:44:53 +08:00
DreamPiggy 07494e4895 Fix the manager's wrong nullable property to nonnull 2018-03-31 17:59:42 +08:00
DreamPiggy 92f3d2c795 Remove the `maxConcurrentDownloads`, which can be set from downloader configuration. Rename the `prefetcherQueue` to `delegateQueue` to match the correct description.
Fix the delegateQueue to async dispatch, avoid immediate callback cause recursion call(Match previous behavior)
2018-03-31 17:47:55 +08:00
DreamPiggy 915278bfd8 Update the comments and demo for macOS 2018-03-29 19:43:34 +08:00
DreamPiggy 082c5af565 Add APNG coder to support static PNG & APNG rendering. Also update macOS's SDAnimatedImageRep 2018-03-29 17:45:56 +08:00
DreamPiggy 920d61f47e Separate the image class and coder class's protocol. Make this two more modular 2018-03-29 14:16:27 +08:00
DreamPiggy 16d39e4982 Remove the unused NSImageView imageScale and alignment override 2018-03-29 02:50:05 +08:00
DreamPiggy f0f23a76f1 Update the comments 2018-03-29 02:41:34 +08:00
DreamPiggy 82e3779426 Fix the macOS animated image rendering issue by using the correct layer 2018-03-29 02:33:38 +08:00
DreamPiggy a6d61c409d Fix compile issue and test 2018-03-25 20:44:41 +08:00
DreamPiggy d49d7f7c0a Add the removal and status method for animated image preloading. Update the comments 2018-03-25 17:32:48 +08:00
DreamPiggy 5e09c6bf19 Add support for imageNamed: in SDAnimatedImage with bundle files 2018-03-25 17:32:48 +08:00
DreamPiggy 7e83d78ca3 Add tests about SDAnimatedImage SDAnimatedImageView and SDAnimatedImage+WebCache 2018-03-25 17:32:48 +08:00
DreamPiggy 4563e714d7 Support progressive decoding for animated image. A little refactory to make coder protocol more readable 2018-03-25 17:32:19 +08:00
DreamPiggy f94dd00c52 Use the context arg to pass the SDAnimatedImage class to create the instance by image cache and downloader.
Also enhance view category to support firstFrameOnly, scaleFactor and preload
2018-03-25 17:29:11 +08:00
DreamPiggy 87bbcdc46f Introduce SDAnimatedImage and SDAnimatedImageView for high performance animated image rendering on iOS & macOS 2018-03-25 17:23:12 +08:00
DreamPiggy 34cca584c2 Merge branch 'master' of https://github.com/rs/SDWebImage into 5.x 2018-03-24 20:40:55 +08:00
DreamPiggy 1c8205b17d Use a weak pointer array to avoid prefetch token strong reference to the operation. And fix the thread-safe problem. 2018-03-24 20:31:34 +08:00
DreamPiggy bb5bd74b81 Fix the wrong declaration of NSArray generics 2018-03-23 22:09:04 +08:00
DreamPiggy ec7927b25a Update the transformer to use as immutable class. Move the tests into SDWebImageTransformerTests 2018-03-23 15:48:58 +08:00
DreamPiggy ed0100c323 Move the NSBezierPath and UIColor category into implementation because it's now for internal use only 2018-03-18 23:00:35 +08:00
DreamPiggy 67285ee722 Add the test for transformer property 2018-03-17 22:31:28 +08:00
DreamPiggy a2076d362e Add sd_colorsWithRect method and test, treat RGB color with default alpha 1.0 2018-03-17 21:18:20 +08:00
DreamPiggy 57408d8313 Fix the potential leak of CFDataRef 2018-03-17 21:18:20 +08:00
DreamPiggy 3e3ec8d513 Change the hex color from 0x00000000 format to #00000000 2018-03-17 21:18:20 +08:00
DreamPiggy aea81791ec Fix the test on macOS. Fix the issue when using rounded corner 2018-03-17 21:18:20 +08:00
DreamPiggy 01402c0369 Add one `colorAtPoint` to help user get the pixel color. Expose the category for `UIColor` and `NSBezierPath` because it can be used in common cases 2018-03-17 21:18:19 +08:00
DreamPiggy 8742e21fab Do not expose the separator because of extensibility, use a function instead 2018-03-17 21:18:19 +08:00
DreamPiggy 44d266af7c Add transformer property in manager level to allow a central control of image transform(optional) 2018-03-17 21:18:19 +08:00
DreamPiggy 464d725368 Adopt the transformer to cache & manager. Use a new context option SDWebImageContextCustomTransformer to bind the transformer
Drop old way of delegate method for transformer. Add two new delegate methods to allow advanced use case after we remove that.
2018-03-17 21:18:19 +08:00
DreamPiggy b4ea87f6c5 Add image transformer protocol and class. Add UIImage+Transformer category including common image geometry, tinting, blur effect processor. 2018-03-17 21:18:19 +08:00
DreamPiggy 5ff999f3d1 Merge branch 'master' of https://github.com/rs/SDWebImage into 5.x
* 'master' of https://github.com/rs/SDWebImage:
  Bumped version to 4.3.3
  Add cacheKeyFilter to allow user provide modified version of data when storing the disk cache in SDWebImageManager

# Conflicts:
#	SDWebImage/SDWebImageManager.h
2018-03-13 00:04:35 +08:00
DreamPiggy 9ca9fa3d96
Merge pull request #2245 from dreampiggy/feature_cache_serializer
Add cacheKeyFilter to allow user provide modified version of data when storing the disk cache in SDWebImageManager
2018-03-12 22:57:34 +08:00