Commit Graph

64 Commits

Author SHA1 Message Date
herrernst 83843a493a Save image in cache before calling completion block 2014-04-26 12:43:25 +02:00
jason 8b315a3585 add support for high priority download 2014-03-15 03:24:02 +08:00
Fabrice Aneche bdea43aec1 Dot-notation should always be used for accessing and mutating properties. Bracket notation is preferred in all other instances 2014-01-06 17:30:34 -08:00
Fabrice Aneche 6dc02bd8f7 reformat code (appcode) 2014-01-06 17:12:24 -08:00
Jens Andersson fbe3b95e8c Added new option to allow invalid SSL Certificates. Useful for testing 2013-12-11 13:31:03 +01:00
Bogdan Poplauschi b201e137d8 Added PNG detection to be able to determine at runtime if a downloaded image should be saved as PNG or as JPEG 2013-12-11 12:15:05 +01:00
Dan Peleg d08d63fadd Added SDWebImageOption to enable Cookies Handling. 2013-11-18 17:18:58 -05:00
Luis Solano Bonet 81d6bf91a9 Provide background option through the manager 2013-10-23 14:20:12 -04:00
Don 8a2ae7e547 Fixed styling to match rs/SDWebImage repo 2013-09-12 13:45:11 -07:00
Don 547345c7f5 Added and exposed some methods that allow to check if an image exists on disk without taking it off disk and decompressing it first. Makes for a nice performance boost when checking if many files exist in the disk cache already 2013-09-12 11:58:43 -07:00
Gabriele Petronella f37474d5c8 Enforced presence of a completedBlock in downloadWithURL:options:progress:completed:
This method bails out in case of a missing `completedBlock`. While this makes sense (downloading the image without a completion block and not doing anything with it is pointless), a client passing a empty block is not informed about the mistake.

`NSParameterAssert` validates the input and it informs the client about bad usage of the API.
2013-08-29 12:46:15 +01:00
Matt Pennig fa987a1818 Canceling the SDWebImageOperation will also cancel the expensive disk cache query operation. 2013-08-11 23:12:55 -07:00
Olivier Poitrey 5f12cabdac Fix unreleased operation (fix #466, fix #444) 2013-08-09 00:39:46 -07:00
Olivier Poitrey 1e63f33a85 Always call the completedBlock from main thread (fix #397)
This is not a good practice but doing otherwise leads to a lot of mistakes
2013-08-07 21:15:32 -07:00
Olivier Poitrey 3a6d9481c9 Call handlers on the main thread synchronously to enhance responsivity (fix #462) 2013-08-07 21:07:59 -07: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
Dale Buckley 7d9c93fb51 #406 - Fixed a problem where hitting a failed URL more than once wouldn't call the completion block 2013-06-04 12:04:36 +01:00
Olivier Poitrey ff2b30e263 Merge pull request #383 from garthex/white_png_issue
fix alpha pngs turning into white pngs
2013-05-14 02:57:12 -07:00
Charlie Savage 0426f07355 Images can be downloaded in multiple threads. Therefore the call to self.failedURLs containsObject:url must be synchronized to avoid a collection mutation error. 2013-05-07 13:21:04 -06:00
Kyle Fleming e3b15e3dbe fix alpha pngs turning into white pngs when caching when you have a method that transforms the image but doesn't touch the pngs 2013-05-01 14:36:13 -07:00
Olivier Poitrey 4137bce30d Add prefix to GIF support category's methods 2013-04-29 12:47:37 +02:00
Andy LaVoy f58c2ebb43 moved scaling up the process 2013-04-28 20:10:36 -07:00
Andy LaVoy d789fd92e8 change var name 2013-04-28 15:38:50 -07:00
Andy LaVoy 2a370b062b updated formatting for project 2013-04-28 14:59:33 -07:00
Andy LaVoy 5bf37d5472 cache the GIF data instead of the jpeg representation 2013-04-28 14:37:47 -07:00
Andy LaVoy 3f98095704 support GIFs 2013-04-28 14:06:54 -07:00
Bastian Müller 9eff469cb6 Make SDWebImageManager cache creation extensible 2013-04-27 20:55:06 +02:00
bm-i 55096d8b91 Fix SDWebImageManager transformDownloadedImage
storing data of transformed image instead of downloaded one
(passing nil to storeImage will generate data)
2013-03-12 23:32:35 +01:00
Olivier Poitrey 8cfd26f78b Disable duplicate disk cache prevention with SDWebImageRefreshCached to handle 302 caching correctly
See https://github.com/rs/SDWebImage/pull/326#issuecomment-14791505 for more info
2013-03-12 19:26:53 +01:00
Olivier Poitrey 9a29af466b Fix typo 2013-03-12 19:15:25 +01:00
Olivier Poitrey eed78e37e8 Ensure image isn't decoded twice if not necessary when SDWebImageRefreshCached flag is used #326 2013-03-12 16:35:35 +01:00
Olivier Poitrey a3e3c61d46 Prevent double disk caching when `SDWebImageRefreshCached` option is used #326 2013-03-12 14:55:29 +01:00
Olivier Poitrey 9b574e58bf Force progressive download off when force refresh is on #326 2013-03-12 14:55:05 +01:00
Olivier Poitrey 5cd7c0db46 Fix condition logic issue in #326 2013-03-12 14:31:24 +01:00
Steven Chan bbad1bcfcc New option SDWebImageRefreshCached
Even if the image is cached, fetch the URL again anyway. When set,
NSURLCache is enabled in the downloader via the new option
SDWebImageDownloaderEnableNSURLCache.

NSURLCache will handle the protocol caching while SDWebImage remains
useful for offline images.

This option helps deal with images changing behind the same request URL,
e.g. Facebook graph api profile pics where the request URL
https://graph.facebook.com/[userid]/picture returns a redirect to the
actual profile image.

If a cached image exists, the completion block is called once with the
cached image and again with the final image.
2013-03-12 01:08:57 +08:00
Sebastian Rehnby d57b92cd0e Detect parent operation cancellation in download operation completion block 2013-02-26 12:08:55 +01:00
Olivier Poitrey ebd63a88c1 Add `SDWebImageManager` delegate allowing fine control of manager's cache-in
- `imageManager:shouldDownloadImageForURL:` let delegate to conditionaly block cache-in (fix #134)
- `imageManager:transformDownloadedImage:` let delegate to transform the image prior to cache-in (fix #63, fix #284)
2013-02-17 00:55:27 +01:00
Olivier Poitrey b27d5719c2 Synchronize access to SDWebImageManager's mutable structures (fix #301) 2013-02-16 17:49:27 +01:00
NachoSoto 42c7455776 Check SDWebImageCacheMemoryOnly for disk caching 2013-01-29 20:10:09 +00:00
Olivier Poitrey 555a320b9e Merge pull request #260 from kawanet/master
isRunning method added at SDWebImageManager
2013-01-16 02:26:04 -08:00
Matej Bukovinski e31b157394 Don't dispatch cancelAll calls.
- should fix pre-fetcher problems #247
- cancelAll should be always called using the main thread
2013-01-11 13:54:54 +01:00
Olivier Poitrey b398208beb Do not mark URLs a fail when error is due to missing network connection 2013-01-11 01:14:56 +01:00
Alex Burgel cfb65f2d75 Change SDWebImageManager to use shared image cache 2013-01-04 16:45:09 -05:00
kawanet e8b1532cba isRunning method added at SDWebImageManager 2012-12-25 22:02:48 +09:00
Olivier Poitrey ddd03f7d2c Add some sanity check on the URL parameter 2012-11-29 18:52:28 +01:00
Matej Bukovinski 9546c84f94 Making sure cache queries always callback in the main thread.
- queryDiskCacheForKey:done: now always invokes the callback in the main thread
- removed the now redundant main thread dispatch in the image manager class
2012-11-19 16:17:27 +01:00
Matej Bukovinski 331053d26e Calling completion callbacks in the main thread.
- made sure this is true even if the downloader is used on its own
- SDWebImageManager doesn't need to perform a dispatch to the main thread any longer
2012-11-19 16:06:05 +01:00
Matej Bukovinski 9a3aff4851 Always making callbacks using the main thread.
Even if using the downloader directly without SDWebImageManager.
2012-11-19 16:03:39 +01:00
Matej Bukovinski ab185ea6e8 Implemented progress callbacks and related fixes. 2012-11-19 15:58:50 +01:00
Matej Bukovinski 2e8c02556a Passing the exact cache type in the completion block.
- none, disk and memory
- can still be used as a bool (if true there was a cache hit)
2012-11-19 15:55:09 +01:00