Swift package wrapper around the gifski library for making GIFs. This package directly exposes the gifski C api and is just a convenience to not needing to build it yourself. In the future I'm planning on a second package that wraps this one and exposes and better Swift interface.
Add this package to your project using Swift Package Manager and import Gifski
. From there you can reference the C api and call the C functions directly.
Gifski is written in Rust and provides an xcodeproj for building. I'm not sure if there is a way to have SPM build it from source, so for now this builds and distributes a compiled binary target as an XCFramework. First, ensure you have the latest version of Rust installed following instructions here.
To update to the latest version of gifski for distribution:
- Update the gifski submodule to the latest tagged release in the
gifski/gifski
directory - Run the script in
gifski/build.sh
to build the latest into a framework - Commit the updated files
- Tag the release with the same version number as upstream gifski release.
If there's a better way to do any of this, let me know. I haven't found a lot of documentation about this use case.
All code in this repo is provided under the MIT license. However, please note that gifski is provided under a different license (currently AGPL 3 or later) with options for commercial licenses. It's your responsibility to ensure you're compliant with that license if you're using this package and therefore that library.