Commit Graph

1357 Commits

Author SHA1 Message Date
Bogdan Poplauschi f55635de1a Accidentally deleted a comma from an array declaration 2017-10-20 22:32:48 +03:00
Bogdan Poplauschi ed411dcba9 Finally fixed the tests from `SDImageCacheTests` so we can re-enable `test40InsertionOfImageData`
- 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.
2017-10-20 21:14:25 +03:00
Bogdan Poplauschi 86151183f6 Switched all the tests from using https://s3.amazonaws.com/fast-image-cache/demo-images/* images which are big and sometimes fail to arrive in 5 seconds (before the test can timeout) to smaller images, basically using http://via.placeholder.com/ like http://via.placeholder.com/50x50.jpg or http://via.placeholder.com/200x200.png
This should speed up the tests a bit and also avoid some of the random failures due to timeout
2017-10-20 20:29:18 +03:00
Bogdan Poplauschi 90c90a06bc Refactored the `SDWebImageDecoderTests` a bit. Per DRY, created `verifyCoder:withLocalImageURL:isAnimatedImage:` method that will take a imageURL and a coder and will check decoding and encoding back and forth, sizes and so. Reusing this method for the static WebP image, for the animated WebP image and for the GIF. 2017-10-20 18:40:09 +03:00
Bogdan Poplauschi f57c21d52a Improved the code coverage of our unit tests (given that we disabled test40InsertionOfImageData).
Also updated the Tests Podfile so we don't get a warning (xcodeproj was renamed to project)
2017-10-20 16:15:38 +03:00
Bogdan Poplauschi 30275b4415 Merge pull request #2067 from dreampiggy/feature_gif_encoding_macOS
Add the animated GIF encoding support for SDWebImageGIFCoder on macOS(use NSImage's API)
2017-10-19 20:51:06 +03:00
Bogdan Poplauschi 5804934a69 Merge pull request #2066 from dreampiggy/fix_progressive_webp_height_issue
Provide a way to fix libwebp’s bug during WebP progressive decoding f…
2017-10-19 20:50:21 +03:00
Bogdan Poplauschi 05828742e8 Just disabled this test test40InsertionOfImageData - keeps failing for unknown reasons (strangely sometimes the data doesn't get written to disk) 2017-10-19 19:15:21 +03:00
DreamPiggy 23a174d859 Provide a way to fix libwebp’s bug during WebP progressive decoding for x86 architecture (macOS and iPhone simulator). It kept the previous decoded partial bitmap and will cause current image looks strange. 2017-10-19 02:01:46 +08:00
DreamPiggy 2860b78a38 Add the animated GIF encoding support for SDWebImageGIFCoder on macOS(use NSImage’s API) 2017-10-19 01:58:35 +08:00
Bogdan Poplauschi e1a76d76bd Merge pull request #2057 from dreampiggy/feature_disk_cache_reading_options
Allow user to provide reading options such as mapped file to improve performance in SDImageCache disk cache
2017-10-18 19:20:54 +03:00
Bogdan Poplauschi 748c7d46b6 Explicitly set `diskCacheReadingOptions` to its default value 0 2017-10-18 19:21:15 +03:00
Bogdan Poplauschi 4ea5423064 Fix the build due to #2064 changes - had to make sure pod lib lint works on macOS as well 2017-10-18 19:10:18 +03:00
Bogdan Poplauschi f3524d33e5 Attempt to fix the build - the Tests target link to SDWebImage.framework (iOS), so cleaning the schemes that have built that. The problem now with Xcode 9 is that those targets already contain the libwebp and FLAnimatedImage files, Xcode will not rebuild the framework from the proper sources and then we will have duplicate symbols with the libwebp and FLAnimatedImage files that are also compiled by CocoaPods separately. 2017-10-18 15:22:01 +03:00
Bogdan Poplauschi 81c7108706 Merge pull request #2064 from dreampiggy/feature_gif_category_support_animate_again
Give back our GIF category animation support since we now use plugin coders
2017-10-18 12:03:21 +03:00
Bogdan Poplauschi a32ab28acb Comment updates 2017-10-18 12:01:26 +03:00
DreamPiggy 17386829c1 Give back our GIF category animation support since we now use plugin coders. This will not affect FLAnimatedImageView which just create the first frame.
1. Change default coders to [IOCoder, WebPCoder]
2. Add back our previous GIF decoding code, with loop count support
3. Add GIF encoding code for animation
4. Modify IOCoder for GIF format because FLAnimatedImageView need just use the first frame
2017-10-18 02:25:05 +08:00
Bogdan Poplauschi d12484a762 Updated diagrams per latest master change 2017-10-17 18:40:01 +03:00
Bogdan Poplauschi bd8d01aa30 Let's try building with Xcode 9 2017-10-17 17:52:55 +03:00
Bogdan Poplauschi 5c33c10617 Merge pull request #1991 from dreampiggy/feature_refactor_decoding_with_plugin
Feature: refactor decoding code and provide decoding plugin
2017-10-17 17:38:50 +03: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
DreamPiggy e1603e1800 Allow user to provide reading options such as mapped file to improve performance in SDImageCache disk cache 2017-10-14 13:54:21 +08:00
Bogdan Poplauschi c1df782869 Bumped version to 4.1.2 and added to changelog 2017-10-09 09:31:38 +03:00
Bogdan Poplauschi 322070e2c4 Merge pull request #2051 from dreampiggy/fix_progressive_totalsize_protect
Change finished check from equal to equal or greater than to protect …
2017-10-09 09:16:10 +03:00
Bogdan Poplauschi 25837a32e4 Merge pull request #2050 from dreampiggy/performance_webp
Static WebP decoding a little enhancement. Do not need create WebP it…
2017-10-09 09:10:35 +03:00
DreamPiggy 9fef316dfa Change finished check from equal to equal or greater than to protect accident condition 2017-10-09 12:48:29 +08:00
DreamPiggy 756e59a995 Static WebP decoding a little enhancement. Do not need create WebP iterator for static images. 2017-10-09 11:47:02 +08:00
Bogdan Poplauschi e59d34fdb7 Merge pull request #2049 from dreampiggy/fix_operation_not_call_done
Fix SDWebImageDownloaderOperation not call done when use SDWebImageDownloaderIgnoreCachedResponse
2017-10-08 19:49:33 +03:00
DreamPiggy 4991cb3038 Fix web format check not use immutable image data 2017-10-08 14:15:42 +08:00
DreamPiggy 624aa1e258 Fix SDWebImageDownloaderIgnoreCachedResponse early return without call done method 2017-10-08 14:13:14 +08:00
Bogdan Poplauschi 93a386ed0f Bumped version to 4.1.1 + updated changelog 2017-10-06 21:57:54 +03:00
Bogdan Poplauschi ff0690547d Xcode 9 recommended settings applied 2017-10-06 20:58:44 +03:00
Bogdan Poplauschi 4258154c2d Merge pull request #1983 from dreampiggy/fix_webp_import_issue
Fix SDWebImage v4 can not import libwebp framework's header files.
2017-10-06 20:52:12 +03:00
Bogdan Poplauschi 50e26dc5f7 Merge pull request #2032 from dreampiggy/adopt_refresh_cache_behavior
Adopt the previous version behavior about SDWebImageDownloaderIgnoreC…
2017-10-06 20:43:34 +03:00
DreamPiggy 44e80816f0 Fix SDWebImage v4 can not import libwebp framework's header files.
Fix FLAnimatedImageView mixed local and global import
2017-10-06 12:27:24 +08:00
DreamPiggy 7491510f7e Adopt the previous version behavior about SDWebImageDownloaderIgnoreCachedResponse and SDWebImageRefreshCached without hack code 2017-10-06 12:13:31 +08:00
DreamPiggy 52993c7150 Merge pull request #2040 from dreampiggy/Fix_progressive_download_gray_background
Use CGImageSourceCreateIncremental to perform progressive decoding in…
2017-09-29 23:25:53 -05:00
DreamPiggy 91aef6442c Remove unused Image IO header 2017-09-30 12:03:57 +08:00
DreamPiggy 05fea33dac Merge pull request #2043 from dreampiggy/set_uibutton_placeholder_if_url_is_nil
Set UIButton's placeholer-image even if the url is nil
2017-09-29 12:21:38 -05:00
DreamPiggy 3ab924b016 Set UIButton's placeholer-image even if the url is nil 2017-09-29 23:40:43 +08:00
DreamPiggy 250e1fc87f Merge pull request #1985 from dreampiggy/performance_webp_decoding_optimize
Performance enhancement related to single WebP and animated WebP decoding...
2017-09-29 12:01:18 +08:00
DreamPiggy facdc9925b Use CGImageSourceCreateIncremental to perform progressive decoding instead of decode partial data each time from the beginning to improve performance and remove that gray background 2017-09-29 11:54:26 +08:00
DreamPiggy df099ced20 Performance enhancement related to single WebP image and animated WebP decoding
1. Change the code to not decode WebP images created in SD because it has been decoded
2. Add @autoreleasepool for animated WebP decoding do-while loop to reduce memory peak
2017-09-29 11:04:28 +08:00
DreamPiggy cd1158055a Merge pull request #2011 from dreampiggy/Fix_downloadOperation_imagedata_crash
Fix SDWebImageDownloadOperation imageData multi-thread issue.
2017-09-28 14:05:46 +08:00
DreamPiggy d36a664ef8 Merge pull request #2035 from dreampiggy/fix_macos_demo_deployment_target
Update macOS Demo deployment target to 10.10 to support build on Xcode 9
2017-09-26 14:49:22 +08:00
DreamPiggy a33d8dd7e0 Update macOS Demo deployment target to 10.10 to support build on Xcode 9 2017-09-26 13:56:35 +08:00
DreamPiggy 266b9be6a7 Merge pull request #2031 from dreampiggy/add_refresh_cache_test
Add a test for SDWebImageRefreshCached
2017-09-24 11:02:27 +08:00
DreamPiggy 74566aeb98 Add a test for SDWebImageRefreshCached 2017-09-23 20:34:08 +08:00
DreamPiggy 207677a6a4 Update ManualInstallation.md (#2030)
Fix `Other Linker Flags` images
2017-09-23 19:14:19 +08:00
DreamPiggy f5570320ed Merge pull request #2027 from dreampiggy/fix_test_prototype_warning
Fix clang strict prototype warning in test
2017-09-21 10:44:30 +08:00