iosswiftsdwebimagewebp

Does SDWebImage support webp images without SDWebImageWebPCoder?


I was able to download and display Webp images without SDWebImageWebPCoder using SDWebImage 5.13.4. So what is the purpose of SDWebImageWebPCoder? Does SDWebImage already support Webp or am I wrong about something here? How can I identify if Webp images are being downloaded to my app or not?


Solution

  • According to the ReadMe:

    WebP format from iOS 14/macOS 11.0 via SDWebImageAWebPCoder. For lower firmware, use coder plugin SDWebImageWebPCoder

    Google introduce the WebP format, and Apple decided later to support it, natively in UIKit.framework. So, natively, UIImage(data: webpData) works on iOS14 +.

    Depending on which version of iOS you want to support for your App, you might need or not the SDWebImageWebPCoder plug-in lib, which will decode manually the WebP image raw data.