https://github.com/sdwebimage/libwebp-xcode
A wrapper for libwebp + Xcode project. Support Carthage && CocoaPods && SwiftPM.
https://github.com/sdwebimage/libwebp-xcode
carthage ios macos swiftpm tvos watchos webp
Last synced: 18 days ago
JSON representation
A wrapper for libwebp + Xcode project. Support Carthage && CocoaPods && SwiftPM.
- Host: GitHub
- URL: https://github.com/sdwebimage/libwebp-xcode
- Owner: SDWebImage
- License: bsd-3-clause
- Created: 2018-08-28T12:27:34.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2025-02-12T12:20:14.000Z (5 months ago)
- Last Synced: 2025-06-04T03:25:55.801Z (24 days ago)
- Topics: carthage, ios, macos, swiftpm, tvos, watchos, webp
- Language: Ruby
- Homepage:
- Size: 56.6 KB
- Stars: 64
- Watchers: 11
- Forks: 41
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# libwebp + Xcode
A wrapper for [libwebp](https://github.com/webmproject/libwebp) + Xcode project.
This enables Carthage support
This also contains the Swift Package Manager support[](https://travis-ci.org/SDWebImage/libwebp-Xcode)
[](https://github.com/SDWebImage/libwebp-Xcode)
[](https://swift.org/package-manager/)## Requirements
+ iOS 8
+ macOS 10.11
+ tvOS 9.0
+ watchOS 2.0## Installation
#### CocoaPods
libwebp is available through [CocoaPods](http://cocoapods.org). To install it, simply add the following line to your Podfile:
```ruby
pod 'libwebp'
```### Carthage
libwebp is (via this repo) available through [Carthage](https://github.com/Carthage/Carthage).
```
github "SDWebImage/libwebp-Xcode"
```### SwiftPM
Libwebp is available through [Swift Package Manager](https://img.shields.io/badge/SwiftPM-compatible-brightgreen.svg).
```swift
let package = Package(
dependencies: [
.package(url: "https://github.com/SDWebImage/libwebp-Xcode", from: "1.1.0")
],
// ...
)
```## Usage
Use libwebp as you would normally, this is just a repo that adds an Xcode proj.
For Swift Package Manager user, it's recommended to use the modular import instead of C headers.
+ Objective-C
```objective-c
@import libwebp;
// or if you don't use module
#import
#import
```+ Swift
```swift
import libwebp
```## About sharpyuv
From libwebp v1.2.3, Google separate some functions into a new standalone lib called `sharpyuv`. However, it dependeny source code from libwebp repo's `src` as implementation. Like llvm-project monorepo, one repo host multiple targets.
Before v1.3.0, we hide these headers as internal headers.
From v1.3.0, we expose the sharpyuv public headers, but not a standalone CocoaPods/SPM/Carthage Target. (In the future we may consider separate targets)
If you want to use sharpyuv functions, do something like this:
+ Objective-C
```
// This does not supports module include
#if __has_include()
#import
#else
#import // bundled in libwebp's modulemap
#endif
```+ Swift
```swift
#if canImport(sharpyuv)
import sharpyuv
#else
import libwebp // bundled in libwebp's modulemap
#endif
```## License
libwebp is available under the BSD-3 license. See [the LICENSE file](https://github.com/webmproject/libwebp/blob/master/COPYING) for more info.