Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/massivdash/cargo-imagermachine
https://github.com/massivdash/cargo-imagermachine
Last synced: 1 day ago
JSON representation
- Host: GitHub
- URL: https://github.com/massivdash/cargo-imagermachine
- Owner: MassivDash
- License: mit
- Created: 2022-02-22T13:59:07.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-01-20T23:51:26.000Z (almost 2 years ago)
- Last Synced: 2024-04-24T04:47:41.408Z (7 months ago)
- Language: Rust
- Size: 1.74 MB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Welcome to Cargo Imagermachine 👋
## Rust cli for batch optimizing images
Cargo-imagermachine was designed as a subtool of cargo package manger, so user can run the interactive cli from the command line inside folders that contain pictures.
Imagermachine uses turbo-jpeg library for jpeg files optimization and oxi png for png images. You must install the turbo-jpeg yourself as the cli uses only the bindings to the turbo-jpeg library. Installation guide for respective systems below.
Imagermachine can:
- Optimize png and jpg images.
- Resize and crop images.
- Rename the transformed files based on provided_name_(index).ext
- Convert files to Webp
- todo: set optimalisation custom config---
### Dependencies
So far the cli has been tested on unix systems (Debian, Mac).
Before using cargo-imagermachine you must install#### Rust
Follow the official guideline for installing rust on your system
https://www.rust-lang.org/tools/install#### Libturbojpeg
Offical webiste and documentation 👉 https://www.libjpeg-turbo.org/
*Debian*
```bash
sudo apt-get install libturbojpeg libturbojpeg0-dev
```This should be enough to get started on Ubuntu
*Mac*
```bash
brew install jpeg-turbo
```! Remember to copy all the export paths that brew will print out after installation, I am using the following config in the cargo.toml file, pkg-config (also via brew) installation is needed for this setup to work.
```yml
turbojpeg = {version = "0.4", features = ["image", "pkg-config"]}
```If you have troubles linking the cli to your libturbo, you can try to edit the cargo.toml file and add feature flags into turbojpeg features array, for more reference follow this [link](https://github.com/honzasp/rust-turbojpeg#requirements).
---
### Install
In order to install cargo-imagermachine on your computer, clone the project then run the following command from the project folder:```sh
cargo install --path .
```### Usage
If you followed the offical rust documentation and cargo / rustc is in scope, navigate to a input folder and run
```sh
cargo imagermachine
```Follow directions on the interactive cli to optimize, resize, rename the images.
### Author
👤 **Lukasz Celitan**
* Website: https://spaceout.pl
* Twitter: [@spaceoutPL](https://twitter.com/spaceoutPL)
* Github: [@MassivDash](https://github.com/MassivDash)
* LinkedIn: [@luke-celitan-99920b168](https://linkedin.com/in/luke-celitan-99920b168)## Show your support
Give a ⭐️ if this project helped you!