SDWebImage icon indicating copy to clipboard operation
SDWebImage copied to clipboard

Feature Request - Allows load arbitery URL data which is not an image

Open huangboju opened this issue 4 years ago • 8 comments

Thank you for providing such a great repo

I think you can open more api

For example: I want to use SDWebImagePrefetcher download some files, preload and cache

but in the SDWebImageDownloaderOperation, the data must is ImageData

otherwise, it will be error

image

huangboju avatar Mar 27 '20 09:03 huangboju

I want to use SDWebImagePrefetcher download some files, preload and cache but in the SDWebImageDownloaderOperation, the data must is ImageData

@huangboju You mean, you want to download something Not a Image, for example, download https://www.baidu.com/index.html or https://github.com/SDWebImage/SDWebImage/archive/5.6.1.zip into a raw data ?

If your downloaded file, can represent a Image in some aspect, for example, like SDWebImageLinkPlugin which query the website favicon icon, you can do this. But, for any other than image, we can not help...

Because this beyond SDWebImage's capabilities, we're WebImage, not a Network Framework 😅

dreampiggy avatar Mar 27 '20 10:03 dreampiggy

Actually, I think using NSURLSession directlly is not hard as our API...

dreampiggy avatar Mar 27 '20 10:03 dreampiggy

@dreampiggy I don't just want to download files, include cache management

If i rewrite a Prefetcher , it will have a lot of duplicate code in my project

I think SDWebImage can become more powerful and modular

After all, most programmers can't write such good downloader and cacher

huangboju avatar Mar 28 '20 04:03 huangboju

Seems a feature request which will effect the API (Because now, the completion block does not contains Image, maybe we can make it a protocol to callback anything).

Marked as 6.0.0 milestone.

You can join https://gitter.im/SDWebImage/community here to talk in Chiniese about your use case

dreampiggy avatar Mar 28 '20 04:03 dreampiggy

For temp workaround, you can use Custom Download Operation, to override the URLSession:task:didCompleteWithError: method.

dreampiggy avatar Mar 28 '20 04:03 dreampiggy

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this is still an issue, please make sure it is up to date and if so, add a comment that this is still an issue to keep it open. Thank you for your contributions.

stale[bot] avatar May 29 '20 03:05 stale[bot]

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this is still an issue, please make sure it is up to date and if so, add a comment that this is still an issue to keep it open. Thank you for your contributions.

stale[bot] avatar Jul 29 '20 05:07 stale[bot]

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this is still an issue, please make sure it is up to date and if so, add a comment that this is still an issue to keep it open. Thank you for your contributions.

stale[bot] avatar Nov 09 '20 02:11 stale[bot]