This project is a fastlane plugin. To get started with fastlane-plugin-tinifyme
, add it to your project by running:
fastlane add_plugin tinifyme
Compress assets using TinyPNG. This plugin was designed to automate image compression in your project via pre-commit hook or one-off runs.
When used as a pre-commit hook, it will search for staged images (added or modified), compress'em, and add them back into the current commit. All you need to do is call your lane invoking the tinifyme action!
You'll need a TinyPNG developer API key, which can be freely obtained on their website: https://tinypng.com/developers.
Check out the example Fastfile
to see how to use this plugin.
Clone the repo and run fastlane install_plugins
.
bundle exec fastlane compress_image file_path:"path/to/file" api_key:"YOUR_API_KEY"
Screen.Recording.2023-07-02.at.22.29.52.mov
- Set your TinyPNG developer API key as the value of the
TINYPNG_API_KEY
env var - Call your fastlane lane from your
.git/hooks/pre-commit
file. For instance:
bundle exec fastlane compress_images_hook
To run both the tests, and code style validation, run
rake
To automatically fix many of the styling issues, use
rubocop -a
For any other issues and feedback about this plugin, please submit it to this repository.
If you have trouble using plugins, check out the Plugins Troubleshooting guide.
For more information about how the fastlane
plugin system works, check out the Plugins documentation.
fastlane is the easiest way to automate beta deployments and releases for your iOS and Android apps. To learn more, check out fastlane.tools.