Skip to content

the-swift-collective/libwebp

Repository files navigation

WebP

Cross platform swift package for the libwebp library.

Usage

To use webp in swift, add libwebp as a package dependency in your project's Package.swift file.
dependencies: [
  .package(url: "https://github.com/the-swift-collective/libwebp.git", from: "1.4.0"),
]
Then, for any target you'd like, add the libwebp product as a target dependency, a complete example.
// swift-tools-version: 5.8
import PackageDescription

let package = Package(
  name: "MyPackage",
  products: [
    .library(
      name: "MyLibrary",
      targets: ["MyLibrary"]
    ),
  ],
  dependencies: [
    .package(url: "https://github.com/the-swift-collective/libwebp.git", from: "1.4.0")
  ],
  targets: [
    .target(
      name: "MyLibrary",
      dependencies: [
        /* add the webp product as a library dependency. */
        .product(name: "WebP", package: "libwebp"),
      ]
    ),
  ]
)


the swift collective - cross platform swift packages.
libwebp is licensed under the terms of the BSD 3-Clause "New" or "Revised" License.