-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
293 additions
and
158 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
github: [ Lymphatus ] | ||
#custom: ['https://www.paypal.com/donate/?hosted_button_id=W74TDJHTBKSAY'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,7 @@ | ||
# To get started with Dependabot version updates, you'll need to specify which | ||
# package ecosystems to update and where the package manifests are located. | ||
# Please see the documentation for all configuration options: | ||
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates | ||
|
||
version: 2 | ||
updates: | ||
- package-ecosystem: "cargo" # See documentation for possible values | ||
directory: "/" # Location of package manifests | ||
open-pull-requests-limit: 0 | ||
schedule: | ||
interval: "weekly" | ||
interval: "weekly" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: Clippy check | ||
on: | ||
- push | ||
- pull_request | ||
|
||
env: | ||
RUSTFLAGS: "-Dwarnings" | ||
|
||
jobs: | ||
clippy_check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Run Clippy | ||
run: cargo clippy --all-targets --all-features |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: Code formatting | ||
|
||
on: | ||
- push | ||
- pull_request | ||
|
||
jobs: | ||
fmt_check: | ||
name: Fmt | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: dtolnay/rust-toolchain@stable | ||
with: | ||
components: rustfmt | ||
|
||
- name: Check code formatting | ||
run: cargo fmt -- --check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,22 @@ | ||
## CHANGELOG | ||
* 0.22.0 - Same folder as input, suffix options + lossless flag | ||
* 0.21.0 - Compress by quality and long/short edge resize options | ||
* 0.20.0 - Keep original dates and format conversion | ||
* 0.19.0 - Rust migration | ||
* 0.18.0 - Fixed Windows build + libcaesium 0.9.3 | ||
* 0.17.0 - libcaesium 0.9.2 | ||
* 0.16.0 - Using libcaesium Rust library | ||
* 0.15.2 - Fixed Windows -RS bug | ||
* 0.15.1 - Fixed rename bug on Windows + "Compressing..." message | ||
* 0.15.0 - Support for libcaesium 0.5.0 | ||
* 0.14.0 - Added --quiet option | ||
* 0.13.1 - Bugfix | ||
* 0.13.0 - Bugfix | ||
* 0.12.1 - Bugfix | ||
* 0.12.0 - Resizing (experimental) | ||
* 0.11.0 - Fixing paths issues and dry-run option | ||
* 0.10.2 - Bugfixes & full Windows support | ||
* 0.10.1 - All features are available | ||
* 0.10.0 - Switched to cmake build system and libcaesium | ||
* 0.9.1 - Initial development stage | ||
|
||
- 1.0.0-beta.0 - Same folder as input, suffix options + lossless flag + code refactoring | ||
- 0.21.0 - Compress by quality and long/short edge resize options | ||
- 0.20.0 - Keep original dates and format conversion | ||
- 0.19.0 - Rust migration | ||
- 0.18.0 - Fixed Windows build + libcaesium 0.9.3 | ||
- 0.17.0 - libcaesium 0.9.2 | ||
- 0.16.0 - Using libcaesium Rust library | ||
- 0.15.2 - Fixed Windows -RS bug | ||
- 0.15.1 - Fixed rename bug on Windows + "Compressing..." message | ||
- 0.15.0 - Support for libcaesium 0.5.0 | ||
- 0.14.0 - Added --quiet option | ||
- 0.13.1 - Bugfix | ||
- 0.13.0 - Bugfix | ||
- 0.12.1 - Bugfix | ||
- 0.12.0 - Resizing (experimental) | ||
- 0.11.0 - Fixing paths issues and dry-run option | ||
- 0.10.2 - Bugfixes & full Windows support | ||
- 0.10.1 - All features are available | ||
- 0.10.0 - Switched to cmake build system and libcaesium | ||
- 0.9.1 - Initial development stage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,145 +1,58 @@ | ||
## Caesium CommandLineTools | ||
###### caesium-clt - v1.0.0-beta.0 | ||
## Caesium Command Line Tools | ||
|
||
###### REQUIREMENTS | ||
* [Rust](https://www.rust-lang.org/tools/install) | ||
---------- | ||
[![](https://img.shields.io/static/v1?label=Sponsor&message=%E2%9D%A4&logo=GitHub&color=%23fe8e86)](https://github.com/sponsors/Lymphatus) | ||
[![Test](https://github.com/Lymphatus/caesium-clt/workflows/Test/badge.svg)](https://github.com/Lymphatus/caesium-clt/actions?query=workflow%3ATest) | ||
[![Clippy](https://github.com/Lymphatus/caesium-clt/actions/workflows/clippy.yaml/badge.svg)](https://github.com/Lymphatus/caesium-clt/actions/workflows/clippy.yaml) | ||
[![Code formatting](https://github.com/Lymphatus/caesium-clt/actions/workflows/fmt.yaml/badge.svg)](https://github.com/Lymphatus/caesium-clt/actions/workflows/fmt.yaml) | ||
|
||
###### COMPILATION | ||
`cargo build --release` | ||
|
||
---------- | ||
|
||
###### USAGE | ||
|
||
``` | ||
Usage: caesiumclt [OPTIONS] <--quality <QUALITY>|--lossless|--max-size <MAX_SIZE>> <--output <OUTPUT>|--same-folder-as-input> [FILES]... | ||
Arguments: | ||
[FILES]... | ||
Options: | ||
-q, --quality <QUALITY> | ||
sets output file quality between [0-100] | ||
--lossless | ||
perform lossless compression | ||
--max-size <MAX_SIZE> | ||
set the expected maximum output size in bytes | ||
--width <WIDTH> | ||
width of the output image, if height is not set will preserve aspect ratio | ||
--height <HEIGHT> | ||
height of the output image, if width is not set will preserve aspect ratio | ||
--long-edge <LONG_EDGE> | ||
sets the size of the longest edge of the image | ||
--short-edge <SHORT_EDGE> | ||
sets the size of the shortest edge of the image | ||
-o, --output <OUTPUT> | ||
output folder | ||
--same-folder-as-input | ||
sets the output folder to be the same as the input folder, overwrites original files | ||
--format <FORMAT> | ||
convert to the selected output format, or keep the original | ||
[default: original] | ||
[possible values: jpeg, png, webp, tiff, original] | ||
--png-opt-level <PNG_OPT_LEVEL> | ||
select level for PNG optimization, between [0-6] | ||
[default: 3] | ||
v1.0.0-beta.0 | ||
|
||
--zopfli | ||
use zopfli when optimizing PNG files (it may take a very long time to complete) | ||
### Development | ||
|
||
-e, --exif | ||
keeps EXIF info during compression | ||
#### Requirements | ||
|
||
--keep-dates | ||
keep original file date information | ||
* [Rust](https://www.rust-lang.org/tools/install) >= 1.79.0 | ||
|
||
--suffix <SUFFIX> | ||
add a suffix to the output filename | ||
#### Build | ||
|
||
-R, --recursive | ||
if input is a folder, scan subfolders too | ||
-S, --keep-structure | ||
keep the folder structure, can be used only with -R | ||
-d, --dry-run | ||
do not write output files | ||
--threads <THREADS> | ||
specify the number of parallel jobs (max is the number of processors available) | ||
[default: 1] | ||
-O, --overwrite <OVERWRITE> | ||
overwrite policy | ||
[default: all] | ||
Possible values: | ||
- all: Always overwrite | ||
- never: Never overwrite | ||
- bigger: Overwrite only if the file to be overwritten is bigger | ||
-Q, --quiet | ||
suppress all output | ||
--verbose <VERBOSE> | ||
select how much output you want to see | ||
[default: progress] | ||
Possible values: | ||
- quiet: Suppress all output | ||
- progress: Show only progress and final results | ||
- warnings-and-errors: Show also skipped and error messages | ||
- all: Print all | ||
`cargo build --release` | ||
|
||
-h, --help | ||
Print help (see a summary with '-h') | ||
### Usage | ||
|
||
-V, --version | ||
Print version | ||
``` | ||
See full usage docs [here](docs/USAGE.md). | ||
|
||
---------- | ||
|
||
###### EX AMPLES | ||
#### Examples | ||
|
||
Losslessly compress ```image1.jpg```, located in the ```home``` directory, into a folder called ```output``` | ||
|
||
``` | ||
$ caesiumclt -q 0 -o ~/output/ ~/image.jpg | ||
``` | ||
|
||
Compress ```image1.jpg```, located in the ```home``` directory, into a folder called ```output``` with lossy compression and quality set to 80 | ||
Compress ```image1.jpg```, located in the ```home``` directory, into a folder called ```output``` with lossy compression | ||
and quality set to 80 | ||
|
||
``` | ||
$ caesiumclt -q 80 -o ~/output/ ~/image.jpg | ||
``` | ||
|
||
Losslessly compress ```image1.jpg```, located in the ```home``` directory, into a folder called ```output``` and keeps EXIF metadata | ||
Losslessly compress ```image1.jpg```, located in the ```home``` directory, into a folder called ```output``` and keeps | ||
EXIF metadata | ||
|
||
``` | ||
$ caesiumclt -q 0 -e -o ~/output/ ~/image.jpg | ||
``` | ||
|
||
Losslessly compress ```Pictures``` folder and subfolders, located in the ```home``` directory, into a folder called ```output``` | ||
Losslessly compress ```Pictures``` folder and subfolders, located in the ```home``` directory, into a folder called | ||
```output``` | ||
|
||
``` | ||
$ caesiumclt -q 0 -R -o ~/output/ ~/Pictures | ||
``` | ||
|
||
Losslessly compress ```Pictures``` folder and subfolders, located in the ```home``` directory, into a folder called ```output``` retaining the input folder structure | ||
Losslessly compress ```Pictures``` folder and subfolders, located in the ```home``` directory, into a folder called | ||
```output``` retaining the input folder structure | ||
|
||
``` | ||
$ caesiumclt -q 0 -RS -o ~/output/ ~/Pictures | ||
``` |
Oops, something went wrong.