Latest 0.3.0
Homepage https://github.com/SDWebImage/SDWebImageFLIFCoder
License MIT
Platforms ios 8.0, osx 10.10, tvos 9.0, watchos 2.0
Dependencies SDWebImage/Core, libflif
Authors

CI Status
Version
License
Platform
Carthage compatible

What’s for

This is a SDWebImage coder plugin to add Free Lossless Image Format support. Which is built based on the open-sourced libflif codec.

This FLIF coder plugin support static FLIF and animated FLIF image decoding and encoding.

Requirements

  • iOS 8.0
  • macOS 10.10
  • tvOS 9.0
  • watchOS 2.0

Installation

CocoaPods

SDWebImageFLIFCoder is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod 'SDWebImageFLIFCoder'

Carthage

SDWebImageFLIFCoder is available through Carthage. Which use libflif as dynamic framework.

github "SDWebImage/SDWebImageFLIFCoder"

Usage

To use FLIF coder, you should firstly add the SDWebImageFLIFCoder to the coders manager. Then you can call the View Category method to start load FLIF images.

  • Objective-C
SDImageFLIFCoder *FLIFCoder = [SDImageFLIFCoder sharedCoder];
[[SDImageCodersManager sharedManager] addCoder:FLIFCoder];
UIImageView *imageView;
[imageView sd_setImageWithURL:url];
  • Swift
let FLIFCoder = SDImageFLIFCoder.shared
SDImageCodersManager.shared.addCoder(FLIFCoder)
let imageView: UIImageView
imageView.sd_setImage(with: url)

SDWebImageFLIFCoder also support FLIF encoding. You can encode UIImage to FLIF compressed image data.

  • Objective-C
UIImage *image;
NSData *imageData = [image sd_imageDataAsFormat:SDImageFormatFLIF];
  • Swift
let image;
let imageData = image.sd_imageData(as: .FLIF)

Screenshot

SDWebImageFLIFCoder
SDWebImageFLIFCoder

These FLIF images are from Phew, you can try the demo with your own FLIF image as well.

Author

DreamPiggy

Thanks

libflif
Phew

License

SDWebImageFLIFCoder is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "SDWebImageFLIFCoder",
    "version": "0.3.0",
    "summary": "A FLIF(Free Lossless Image Format) coder plugin for SDWebImage.",
    "description": "TODO: Add long description of the pod here.",
    "homepage": "https://github.com/SDWebImage/SDWebImageFLIFCoder",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "DreamPiggy": "[email protected]"
    },
    "source": {
        "git": "https://github.com/SDWebImage/SDWebImageFLIFCoder.git",
        "tag": "0.3.0"
    },
    "platforms": {
        "ios": "8.0",
        "osx": "10.10",
        "tvos": "9.0",
        "watchos": "2.0"
    },
    "module_map": "SDWebImageFLIFCoder/Module/SDWebImageFLIFCoder.modulemap",
    "source_files": [
        "SDWebImageFLIFCoder/Classes/**/*",
        "Vendor/libflif/include/*.h",
        "SDWebImageFLIFCoder/Module/SDWebImageFLIFCoder.h"
    ],
    "public_header_files": [
        "SDWebImageFLIFCoder/Classes/SDImageFLIFCoder.h",
        "SDWebImageFLIFCoder/Module/SDWebImageFLIFCoder.h"
    ],
    "libraries": "c++",
    "dependencies": {
        "SDWebImage/Core": [
            "~> 5.0"
        ],
        "libflif": []
    }
}

Pin It on Pinterest

Share This