Commit Graph

168 Commits

Author SHA1 Message Date
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 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 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
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 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
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
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 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 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 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 d5cc827bf8 Move the animated image files into single group 2018-03-29 20:28:50 +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 87bbcdc46f Introduce SDAnimatedImage and SDAnimatedImageView for high performance animated image rendering on iOS & macOS 2018-03-25 17:23:12 +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 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 fc1fd0a74e Create a subclass of NSBitmapImageRep to fix the GIF frame duration issue on macOS 2018-02-18 17:52:13 +08:00
DreamPiggy e012b36679 Refactor the image indicator usage for UIView category. Use two protocol `SDWebImageIndicator` & `SDWebImageProgressIndicator` to make this more customizable. Implement two class about activity indicator and progress indicator for both UIKit/AppKit 2018-02-04 14:37:51 +08:00
DreamPiggy aacca305c0 Fix the macOS wrong minimum deployment target version to 10.9. And also fix the warning on Xcode 9 by enable more warning options 2018-02-01 13:20:55 +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 8590388a6e Add WebCache category for NSButton on macOS 2018-01-25 16:40:40 +08:00
DreamPiggy eedc0ad20c Move the context option to a separate header to allow to be included without dependency, use String Enum to bridge for Swift 2018-01-23 13:48:47 +08:00
DreamPiggy 829d54ff03 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 2018-01-23 11:58:22 +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 9c124435b6 Move the imageLoopCount and isAnimated into UIImage+WebCache file, removed the outdated methods 2018-01-20 16:48:51 +08:00
DreamPiggy caafe27937 Upgrade target deployment version to iOS 8.0 / macOS 10.10 2018-01-01 13:15:51 +08:00
DreamPiggy 8b3c4c2cde Fix Clang Static Analyzer warning for number nil check from Xcode 9.2 2017-12-29 12:52:29 +08:00
DreamPiggy 19f45a3cf4 Feature refactor built-in coders and support animated webp on macOS (#2082)
* Refactor code. Move the C global function to a new SDWebImageCoderHelper class.

1. Create two method for animated image parse. Provide the way to allow animates on macOS
2. Create a new class called SDWebImageFrame to allow abstract usage for animated image
3. Fix EXIF orientation method will crash on iOS 7 because it’s a iOS 8 above API

* Change sd_imageLoopCount to retrieve GIF loop count for NSImage on macOS

* Adopt the refactor code, change our build-in coder with that coder helper method to reduce complexity

* Update the demo project on macOS to show animated WebP
2017-10-31 20:34:05 +02:00
DreamPiggy a0879fc049 Feature: refactor decoding code and provide decoding plugin
- 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
2017-10-16 19:52:18 +03:00
Bogdan Poplauschi ff0690547d Xcode 9 recommended settings applied 2017-10-06 20:58:44 +03:00
Dwayne Coussement 4d99ca6c86 CLANG_WARN_STRICT_PROTOTYPES: Yes please! 2017-08-14 15:05:46 +02:00
Bogdan Poplauschi 1f4f371a7a Bumped libwebp submodule reference to version 0.6.0 2017-07-31 16:28:02 +03:00
Ivan Konov 941fde3279 Current Project Version set to 1 in order to have a default value for CFBundleVersion if set as in Info.plist files. In WebImage/Info.plist is set explicitly to 400. 2017-02-05 23:17:12 -08:00
Bogdan Poplauschi 64878cb24b Merge pull request #1593 from corydolphin:patch/fix-carthage-tvos
Enables BITCODE for tvOS builds
2016-09-30 21:47:09 +03:00
Bogdan Poplauschi 67e0719755 Update according to Xcode 8 recommended settings. Set the deployment target to iOS 8.0. No code signing. Enabled some warnings 2016-09-30 21:06:05 +03:00
Bogdan Poplauschi 88b025a5fa Merge pull request #1438 from lianchengjiang/master
Animated webP support
2016-09-29 18:57:05 +03:00
Bogdan Poplauschi 5fac787866 Really enabled WebP for all the targets 2016-09-29 18:32:02 +03:00
Bogdan Poplauschi 836c15bccf Bumped libwebp to 0.5.1 2016-09-29 18:23:42 +03:00
Bogdan Poplauschi e1840c3262 Refactored all the duplicate code from our WebCache categories into a UIView+WebCache category. All the other categories will make calls to this one. Customization of setting the image is done via the setImageBlock and the operationKey 2016-09-25 19:44:52 +03:00
Bogdan Poplauschi 7d02ffd6ab Created a WebCache Categories Xcode group - contains all the categories that we actually expose, making it easier to work with them 2016-09-25 19:29:14 +03:00
Bogdan Poplauschi 2daeffc773 SDImageCacheConfig.h made public 2016-09-25 19:27:10 +03:00
Bogdan Poplauschi cfc182f2e5 Added SDImageCacheConfig to all targets, test images, code coverage setting, tests for SDImageCache, SDWebImageDownloader, SDWebImageDownloaderOperation, SDWebImageDecoder 2016-09-24 00:14:13 +03:00
Bogdan Poplauschi 0bcb35d697 Last commit missed to add 2 alpha_processing files. 2016-06-14 23:08:28 +03:00
Bogdan Poplauschi ccacfc768d Started using libwep 0.5.0 (changed the submodule hash, updated the files added to our project). To fix "gnu-style inline assembly is disabled" issues, explicitly set WEBP_USE_INTRINSICS for the watchOS targets 2016-06-14 22:03:58 +03:00
Bogdan Poplauschi 8e81f4273f Added the osx platform to the podspec and set the osx deployment target to 10.8 because of some compiler issues (pod lib lint) 2016-06-13 09:47:09 +03:00
Bogdan Poplauschi ac36b84463 Update on the libSDWebImage.a rename to libSDWebImage iOS static.a 2016-06-13 01:23:39 +03:00
Bogdan Poplauschi 683c7edce5 watchOS Demo, created a static watchos lib target, renamed static SDWebImage to "SDWebImage iOS static", added the webp files to all targets (as libwebp is compatible with all 4 platforms). Updated Travis CI 2016-06-13 00:53:08 +03:00
Bogdan Poplauschi 442b134206 OSX Example 2016-06-13 00:09:55 +03:00
Bogdan Poplauschi 4c6eb5e72e OSX compatibility and target. (NSImage+WebCache) for UIImage compatibility
Clarified and simplified the usage of TARGET_OS_* macros. Added SD_MAC, SD_UIKIT, SD_IOS, SD_TV, SD_WATCH.
Updated Travis CI
2016-06-12 23:23:53 +03:00
Bogdan Poplauschi cc7fa8fd93 Projects cleanup, properly set targeted device family, sdkroot and supported platforms. Tried not to set things on the project level that need redefinition at the target level 2016-06-12 21:10:18 +03:00
Cory Dolphin f4875b0efb Enables BITCODE for tvOS builds 2016-06-11 21:43:28 -07:00
Bogdan Poplauschi 3d122e550b WatchOS support - just added a target and the conditional compiling - seems to work (pod lib lint works).
There is an issue, the SDWebImage watchOS target doesn't show the simulator, only Generic Device.
Also need to add some demo and test code.
2016-06-10 08:49:51 +03:00
Bogdan Poplauschi 17d8690127 Merge branch '4.x' into gif
# Conflicts:
#	SDWebImage/MKAnnotationView+WebCache.h
#	SDWebImage/MKAnnotationView+WebCache.m
#	SDWebImage/SDImageCache.h
#	SDWebImage/SDImageCache.m
#	SDWebImage/SDWebImageManager.h
#	SDWebImage/SDWebImageManager.m
#	SDWebImage/UIButton+WebCache.h
#	SDWebImage/UIButton+WebCache.m
#	SDWebImage/UIImageView+HighlightedWebCache.h
#	SDWebImage/UIImageView+HighlightedWebCache.m
#	SDWebImage/UIImageView+WebCache.h
#	SDWebImage/UIImageView+WebCache.m
2016-06-07 12:42:26 +03:00
Bogdan Poplauschi 0df12218b7 Enabled CLANG_ANALYZER_NONNULL per http://indiestack.com/2016/06/nullable-edge-cases/. Small fix for a case where trying to get from a set using a nil key 2016-06-07 08:48:45 +03:00
Bogdan Poplauschi 7684fbd9a7 Merge branch '4.x' into gif
# Conflicts:
#	SDWebImage.xcodeproj/project.pbxproj
2016-06-07 08:39:17 +03:00
Bogdan Poplauschi 3364a981d5 Merge branch 'master' into 4.x
+ SDWebImageDownloader downloadImageWithURL:... properly use the weakself-strongself pattern

# Conflicts:
#	.travis.yml
#	Examples/SDWebImage Demo.xcodeproj/project.pbxproj
#	README.md
#	SDWebImage.xcodeproj/project.pbxproj
#	SDWebImage/SDWebImageDownloader.m
#	SDWebImage/SDWebImageDownloaderOperation.h
#	SDWebImage/SDWebImageDownloaderOperation.m
#	SDWebImage/SDWebImageManager.m
#	Tests/Podfile
#	Tests/SDWebImage Tests.xcodeproj/project.pbxproj
2016-06-07 08:36:45 +03:00
Bogdan Poplauschi 6545a3aba1 Bumped the deployment target to iOS 7 (due to NSURLSession) and also incremented the library version to 3.8.0 2016-06-02 19:10:31 +03:00
Bogdan Poplauschi 4df3934954 Added the FLAnimatedImageView category to the project and made the FLAnimatedImage headers public 2016-06-01 10:06:19 +03:00
Bogdan Poplauschi b4659f7648 Added FLAnimatedImage to the project. Had to bump the deployment target to 6.0 since FLAnimatedImage only supports iOS 6 and later. 2016-06-01 07:01:16 +03:00
Bogdan Poplauschi 503d3aed27 Schemes update (naming) 2016-05-10 08:37:12 +03:00
Bogdan Poplauschi e3ba4110a9 Renamed the schemes for consistency, dynamic frameworks are named SDWebImage instead of WebImage. Updated the Tests Podfile + project. Renamed the WebImage.h to SDWebImage.h to match the framework naming 2016-05-08 22:59:32 +03:00
Bogdan Poplauschi 2a29f4a0b7 Added the WebP files to the WebImage.framework target. Removed some old hack to define empty WebP methods (see #416), will re-add it if needed, right now it prevents the dynamic framework to build.
Sample app links the libSDWebImage.a
2016-05-08 22:41:33 +03:00
Bogdan Poplauschi 260a6f5234 Cleaning up the targets so they are easier to maintain. Right now the plan is to have:
- SDWebImage target that build as a static library (all subspecs included) -> libSDWebImage.a
- in the next step I will create "SDWebImageiOS" and "SDWebImagetvOS" targets that build as dynamic frameworks -> SDWebImageiOS.framework and SDWebImagetvOS.framework
2016-05-08 21:59:15 +03:00
jiangliancheng c2173c1e75 add animated webP support 2016-01-15 23:47:25 +08:00
hoseking 07fe1f0dfe Update project settings for Xcode 7 2015-10-16 11:23:28 -07:00
hoseking 4068b93386 Add tvOS Framework target 2015-10-16 11:23:28 -07:00
Florent Vilmart a897811eb5 Lowers deployment target to 8.0 2015-03-22 16:40:44 -04:00
Florent Vilmart a66a790eb2 Replaces direct calls to UIApplication by peformSelector 2015-03-20 18:37:55 -04:00
Florent Vilmart f2252b3499 Adds shared scheme for WebImage in SDWebImage.xcodeproj 2015-03-19 21:15:53 -04:00
Florent Vilmart c0c5e0d714 Adds Carthage WebImage scheme to workspace 2015-03-19 14:14:11 -04:00
Florent Vilmart 9ee89474ed Adds support for iOS 8+ Framework and Carthage
Adds Instructions for Carthage installation
2015-03-15 12:06:27 -04:00
Bogdan Poplauschi 87384290a4 Moved all schemes to the workspace container plus created scheme for Tests 2014-11-04 12:45:04 +02:00
Bogdan Poplauschi 01931d1d89 Updated libwebp reference to 0.4.2 2014-11-04 10:55:59 +02:00
Bogdan Poplauschi 16eea9f104 Updated references to libwebp files after the changes from their latest release (0.4.1) 2014-08-11 15:00:19 +03:00
Whirlwind 5615cf12de Merge branch 'master' into new_cancel_logic
Conflicts:
	SDWebImage/MKAnnotationView+WebCache.m
	SDWebImage/UIButton+WebCache.m
	SDWebImage/UIImageView+HighlightedWebCache.h
	SDWebImage/UIImageView+HighlightedWebCache.m
	SDWebImage/UIImageView+WebCache.m
2014-06-20 10:51:17 +08:00
Whirlwind 4c18545dbc Refactor the cancel logic 2014-06-19 22:46:37 +08:00
Bogdan Poplauschi dfceb49d2b Reordered categories in project file 2014-06-19 10:35:55 +03:00
Bogdan Poplauschi fe48ee54f3 Added SDWebImageCompat.m to SDWebImage+MKAnnotation target 2014-06-11 12:46:20 +03:00
利辺羅エルネスト 6c79daad00 Update projects to recommended settings 2014-05-21 17:10:25 +09:00
Whirlwind 986794012d add category for imageView's highlighted state 2014-03-03 12:32:27 +08:00
Olivier Poitrey 5f3e9272c8 Fix deployement target for arm64 2014-02-24 09:43:14 -08:00
Fabrice Aneche edc1d882e8 refs #620 move NSData+ImageContenttype to the SDWebImage subdirectory 2014-01-21 09:57:50 -08:00
Fabrice Aneche 5e3384e77b upgrade libwebp to 0.4.0 2014-01-06 14:46:20 -08:00
Fabrice Aneche 6d6796c31a explicit webp detection 2014-01-06 13:00:13 -08:00
Fabrice Aneche d3a9a57a0d support arm64 2014-01-03 17:14:13 -08:00
Olivier Poitrey 5df0eafc92 Fix WebP target 2013-10-04 11:43:27 -07:00
Olivier Poitrey 340db263fa Remove WebP support from default target and add a dedicated target
Too many people have issue with WebP library dependancy.
2013-09-20 10:53:11 -07:00
Olivier Poitrey 0076bb9a55 Share schema so it can be used by Xcode bots 2013-09-20 10:45:35 -07:00
Olivier Poitrey 22cd4e49c4 Fix xcode project settings 2013-08-27 16:23:59 -07:00
Olivier Poitrey 76d2fc8d0e Update project to comply with Xcode 5 2013-08-20 16:25:27 -07:00
Olivier Poitrey 8c295cfe80 Update webp to upstream head 2013-08-19 18:44:27 -07:00
Olivier Poitrey 5ecb8d56af Do not enable webp when not explicitly activated by a macro (fix #415) 2013-06-10 21:42:58 +02:00
Olivier Poitrey 04fa4c97b5 Add WebP format support (fix #410)
How awesome is that?! =)
2013-06-07 20:43:51 +02:00
Olivier Poitrey 1dbb79f903 Refactor GIF support
Remove GIF specific code from main source, isolate it in a UIImage category to ease future addition of format support
2013-06-07 19:39:07 +02:00
Andy LaVoy 3f98095704 support GIFs 2013-04-28 14:06:54 -07:00
odanu 474b0d9496 Added SDWebImageCompact.m to Compile sources of the SDWebImage+MKAnnotation target 2013-03-20 03:44:18 -07:00
Olivier Poitrey 3016754250 Share framework target 2013-01-21 09:27:53 +01:00
Olivier Poitrey c876cafa7a Fix Xcode 4.6 warnings 2012-12-19 16:41:06 +01:00