Skip to content
DreamPiggy edited this page Jan 31, 2019 · 30 revisions

Coder Plugin

SDWebImage supports custom image coder plugin. Which can easily extern image format support when using SDWebImage's core feature.

Our core lib, only use the Apple System build-in codec. Which support the common image format, like JPEG/PNG/GIF/BMP/HEIF. But you can use any of your preferred image formats by using the correct image coder plugins.

You can check some public coder plugin here for image format which is not available from SDWebImage's core repo. See Custom Coder for more detailed usage.

SDWebImage organization maintained

Format Repo Format Code Decode Encode Animation Vector
WebP SDWebImageWebPCoder SDImageFormatWebP Y Y Y N
APNG SDWebImageAPNGCoder SDImageFormatPNG Y Y Y N
HEIF SDWebImageHEIFCoder SDImageFormatHEIF Y Y N N
BPG SDWebImageBPGCoder SDImageFormatBPG = 11 Y Y (~> 0.3) Y N
SVG SDWebImageSVGCoder SDImageFormatSVG = 12 Y N N Y
PDF SDWebImagePDFCoder SDImageFormatPDF = 13 Y N N Y

Community contribution (Welcome !)

Format Repo Format Code Decode Encode Animation Vector

For Coder Plugin Developers

If your custom coder add new image format support, which is not listed in SDWebImage built-in define of SDImageFormat, you can define it and place and update the format code here. To avoid the format code conflict with others. The custom minimum format code should be larger than 10, to keep future reserved format used by SDWebImage core repo.

  • Objective-C
static const SDImageFormat SDImageFormatBPG = 11;
  • Swift
extension SDImageFormat {
    public static let BPG: SDImageFormat = SDImageFormat(rawValue: 11)
}

Clone this wiki locally