onevcat / Kingfisher

A lightweight, pure-Swift library for downloading and caching images from the web.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Decryption for network image

nicop2000 opened this issue · comments

Is it possible to decrypt images on download?
I have stored image data on a public server but it is encrypted and I need to decrypt it after downloading and before displaying the image

I believe this is what you need.

KingfisherManager.shared.downloader.delegate = self

extension YourClass: ImageDownloaderDelegate {
    func imageDownloader(_ downloader: ImageDownloader, didDownload data: Data, for url: URL) -> Data? {
        return data.decrypted
    }
}

Thank you very much :)