Swiftpack.co - Package - ainame/Swift-WebP

Swift-WebP

CI Status

Carthage compatible

Swift Wrapper of libwebp

Current project status

Currently, this is very experimental project. Please feedback me!

Support Versions:

  • libwebp: v1.0.0
  • iOS Deployment Target: 8.0
  • macOS Deployment Target: 10.11

Features.

TODO

will implement following features

  • [ ] Cocoapods supports
  • [ ] support Linux build (Now this repo has incompleted Package.swift)
  • [ ] Advanced Decoding API
  • [ ] Progressively decoding option

Usage

let image = UIImage(named: "demo")
let encoder = WebPEncoder()
let queue =  DispatchQueue(label: "me.ainam.webp")

// should encode in background
queue.async {
    let data = try! encoder.encode(image, config: .preset(.picture, quality: 95))
    // using webp binary data...
}

Example

Please check example projects

Requirements

No need the requirement about libwebp for yourself, this framework contains it.

Installation

Carthage

Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.

You can install Carthage with Homebrew using the following command:

$ brew update
$ brew install carthage

To integrate WebP into your Xcode project using Carthage, specify it in your Cartfile:

github "ainame/Swift-WebP"

Run carthage update to build the framework and drag the built WebP.framework into your Xcode project.

Author

ainame

License

Swift-WebP is available under the MIT license. See the LICENSE file for more info.

Github

link
Stars: 27
Help us keep the lights on

Dependencies

Used By

Total: 0

Releases

v0.0.4 - Feb 7, 2017

  • fix compile option for iOS or macOS

v0.0.3 - Feb 7, 2017

  • support building on Linux

v0.0.2 - Feb 1, 2017

  • update support version of libwebp v0.5.1 -> v0.6.0
  • fix memory leak
  • support older deployment target
    • iOS: 8.0, macOS: 10.11