Commit Graph

195 Commits

Author SHA1 Message Date
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 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
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
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 a6bdba724e Fix all cache test 2018-04-18 19:24:23 +08: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 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 0dfeebefeb Add `SDImageCacheScaleDownLargeImages` to allow cache to scale down large images if need 2018-04-14 22:14:59 +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 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 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 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 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 8742e21fab Do not expose the separator because of extensibility, use a function instead 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 c9dfe39e36 Change all sharedInstance from method to class property 2018-03-11 16:08:33 +08:00
DreamPiggy 6f40adbaa0 Merge branch 'master' of https://github.com/rs/SDWebImage into 5.x
* 'master' of https://github.com/rs/SDWebImage:
  Add a delegate method to control the custom logic when blocking the failed url
  Clarify the block comment in SDWebImageManager
  Enable CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF

# Conflicts:
#	SDWebImage/SDImageCache.m
2018-03-09 16:52:46 +08:00
Scott Berrevoets 3ceb8308eb Enable CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF
This enables the CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF warning on all
targets. #2225 fixed a number of these, but a new one crept back in so
this fixes that issue as well.
2018-03-07 14:40:53 -08:00
DreamPiggy a54f41204d Merge branch 'master' of https://github.com/rs/SDWebImage into 5.x
* 'master' of https://github.com/rs/SDWebImage:
  Bumped version to 4.3.1
  update CHANGELOG
  Create a subclass of NSCache using a weak cache. Only remove the cache when memory warning and sync back the alive instance from weak cache into cache.

# Conflicts:
#	SDWebImage/SDImageCache.m
2018-02-26 12:58:22 +08:00
DreamPiggy 216dfebc4a Create a subclass of NSCache using a weak cache. Only remove the cache when memory warning and sync back the alive instance from weak cache into cache. 2018-02-23 23:34:55 +08:00
DreamPiggy e7e3caae72 Merge branch 'master' of https://github.com/rs/SDWebImage into 5.x
* 'master' of https://github.com/rs/SDWebImage:
  Fix CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF warning
  Disable travis-ci email notification
  Fix prefetcher test to first clear the disk cache, and manager test to only fulfill the finished one
  Improve the travis-ci to not clean the build for dynamic framework to speed up the demo build
  Create a subclass of NSBitmapImageRep to fix the GIF frame duration issue on macOS
  Use lock instead of barrier queue to keep callbacks block thread-safe
  Decode the image in the operation level's queue instead of URLSession delegate queue. Because URLSession delegate queue is a barrier queue and shared between different operations
  Expose the read write to FLAnimatedImage associate to the UIImage to allow advanced feature like placeholder
  Fix that SDImageCacheQueryDataWhenInMemory should response cacheType to memory cache when the in-memory cache hit (#2218)
  Update the docs
  Improvement download operation for priority and some protect (#2208)
  Update the readme about macOS minimum deployment target version
  Fix the macOS wrong minimum deployment target version to 10.9. And also fix the warning on Xcode 9 by enable more warning options

# Conflicts:
#	SDWebImage.podspec
#	SDWebImage.xcodeproj/project.pbxproj
#	SDWebImage/SDImageCache.m
#	SDWebImage/SDWebImageDownloaderOperation.m
#	SDWebImage/SDWebImageFrame.h
2018-02-21 18:59:03 +08:00
DreamPiggy ad02e3eaae Fix CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF warning 2018-02-21 15:30:37 +08:00
DreamPiggy a54d1d7a2f
Fix that SDImageCacheQueryDataWhenInMemory should response cacheType to memory cache when the in-memory cache hit (#2218) 2018-02-12 21:20:49 +08:00
DreamPiggy 2990737821 Merge branch 'master' of https://github.com/rs/SDWebImage into 5.x
* 'master' of https://github.com/rs/SDWebImage:
  Revert that SDImageCacheQueryMemoryOnly because it's misunderstanding. Use `imageFromMemoryCacheForKey` instead
2018-01-26 23:50:17 +08:00
DreamPiggy 1749666720 Revert that SDImageCacheQueryMemoryOnly because it's misunderstanding. Use `imageFromMemoryCacheForKey` instead 2018-01-26 23:42:51 +08:00
DreamPiggy f05a1bf96f Merge branch 'master' of https://github.com/rs/SDWebImage into 5.x
* 'master' of https://github.com/rs/SDWebImage:
  Update the comments and a little enhancement for FLAnimatedImageView Category
  Use a dispatch semaphore to keep thread safe for downloader because it need the hold cancel and add procedure be thread-safe
  Add the current image/alternateImage url for NSButton category. A little code refactoring
  Update macOS demo to add a clear cache button using NSButton category
  Fix that reset alternateImage cancel the image load operation for NSButton+WebCache
  Add WebCache category for NSButton on macOS
  A little enhancement to avoid block capture the heap object
  Use a internal method to avoid thread-safe issue for file manager. Remove that checkIOQueue and add sync version exist API
  Add the image transition argument for all UIView+WebCache, make this easy for user to do some fade transition. It also reuse the current setImageBlock and make it easy to customize

# Conflicts:
#	SDWebImage.xcodeproj/project.pbxproj
#	SDWebImage/SDImageCache.h
#	SDWebImage/SDImageCache.m
#	SDWebImage/UIView+WebCache.h
#	SDWebImage/UIView+WebCache.m
#	WebImage/SDWebImage.h
2018-01-26 22:19:55 +08:00
DreamPiggy fbcfa2808d Use a internal method to avoid thread-safe issue for file manager. Remove that checkIOQueue and add sync version exist API 2018-01-24 23:30:53 +08:00
DreamPiggy a2f760c7be Pass the context arg from the top level to the bottom level to allow specify logic in the future 2018-01-23 21:06:07 +08:00
DreamPiggy b6e108a5b1 Rename `NSImage+WebCache` to `NSImage+Addtions`. Add helper methods, use property based API, which more suitable for Swift 2018-01-22 21:54:12 +08:00
DreamPiggy e4c1ab86e7 Merge branch 'master' of https://github.com/rs/SDWebImage into 5.x
* 'master' of https://github.com/rs/SDWebImage:
  Fix the getSize method which use the default file manager instead of current file manager
  Deprecate the sd_setImageWithPreviousCachedImageWithURL with the specify options to achieve this usage
  Use the @synchronized to access NSURLCache to fix the potential thread-safe problem, also fix that we always use shared cache but not follow session's configuration
2018-01-18 15:15:34 +08:00
DreamPiggy 46a55ba6c7 Merge branch 'master' of https://github.com/rs/SDWebImage into 5.x
* '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
2018-01-17 19:22:54 +08:00
DreamPiggy e9412791bd Fix the getSize method which use the default file manager instead of current file manager 2018-01-16 23:21:26 +08:00
DreamPiggy 44cddbfdbf Add the SDImageCacheQueryMemoryOnly to specify query memory only 2018-01-14 21:47:23 +08:00
DreamPiggy df1bb98ad6 Update the cache options name to make it more clear 2018-01-14 21:12:33 +08:00
DreamPiggy 030a3378da Move that `maxMemoryCost` and `maxMemoryCountLimit` to config property. Add sync version API `diskImageDataExistsWithKey` 2018-01-13 16:46:21 +08:00
DreamPiggy 0930442287 Merge branch 'master' of https://github.com/rs/SDWebImage into 5.x
* 'master' of https://github.com/rs/SDWebImage:
  Update the comments
  Add a query cache options to allow some specify logic.
2018-01-13 15:46:41 +08:00
DreamPiggy 9420a20f3f Add a query cache options to allow some specify logic.
Currently is used for FLAnimatedImage
2018-01-12 18:34:09 +08:00
DreamPiggy 092e88e55f Merge branch 'master' of https://github.com/rs/SDWebImage into 5.x
* 'master' of https://github.com/rs/SDWebImage:
  Update the spec file to define the dependency version for libwebp
  Bugfix for loopCount (#2155)
  Fix that 0 pixels error should be used when width OR height is zero but not AND
  Avoid user accidentally invalidates the session used in shared downloader
  Remove the extra memory warning notification for AutoPurgeCache
2018-01-12 17:35:24 +08:00
DreamPiggy 7704c1e5b5 Remove the extra memory warning notification for AutoPurgeCache 2018-01-04 20:09:18 +08:00
DreamPiggy 0d7c93d7b7 Add a `diskCacheWritingOptions` to allow user to specify disk data writing options 2018-01-03 15:21:09 +08:00
DreamPiggy db5307eb94 Change our imageCache `storeImageDataToDisk` to internal use IO-queue. And also change error from POSIX errno to Cocoa file error 2018-01-03 15:21:02 +08:00
DreamPiggy f2888f799c Merge branch 'master' of https://github.com/rs/SDWebImage into 5.x
* '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
  ...
2017-12-22 21:06:48 +08:00