From 34adafb229f11264ca08c6e80c02798118e6cfe9 Mon Sep 17 00:00:00 2001 From: Anton Novojilov Date: Fri, 10 Sep 2021 14:06:54 +0300 Subject: [PATCH] Fixes --- README.md | 23 +++++++++++++++++++++++ rsz.go | 10 ++++++++-- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index dd064e8..ccd0bf2 100644 --- a/README.md +++ b/README.md @@ -62,6 +62,29 @@ rsz --generate-man | sudo gzip > /usr/share/man/man1/rsz.1.gz ### Usage ``` +Usage: rsz {options} src-image size output-image + +Options + + --filter, -f name Resampling filter name + --list-filters, -F Print list of supported resampling filters + --no-color, -nc Disable colors in output + --help, -h Show this help message + --version, -v Show version + +Examples + + rsz image.png 256x256 thumbnail.png + Convert image to exact size + + rsz -f Lanczos image.png 256x256 thumbnail.png + Convert image to exact size using Lanczos resampling filter + + rsz image.png 25% thumbnail.png + Convert image to relative size (25% of original) + + rsz image.png 0.55 thumbnail.png + Convert image to relative size (55% of original) ``` diff --git a/rsz.go b/rsz.go index f772afb..0cc1434 100644 --- a/rsz.go +++ b/rsz.go @@ -34,7 +34,7 @@ import ( // Basic utility info const ( APP = "rsz" - VER = "0.0.1" + VER = "0.0.2" DESC = "Simple utility for image resizing" ) @@ -401,7 +401,8 @@ func genMan() int { func genUsage() *usage.Info { info := usage.NewInfo("", "src-image", "size", "output-image") - info.AddOption(OPT_FILTER, "Resampling filter name") + info.AddOption(OPT_FILTER, "Resampling filter name", "name") + info.AddOption(OPT_LIST_FILTERS, "Print list of supported resampling filters") info.AddOption(OPT_NO_COLOR, "Disable colors in output") info.AddOption(OPT_HELP, "Show this help message") info.AddOption(OPT_VER, "Show version") @@ -411,6 +412,11 @@ func genUsage() *usage.Info { "Convert image to exact size", ) + info.AddExample( + "-f Lanczos image.png 256x256 thumbnail.png", + "Convert image to exact size using Lanczos resampling filter", + ) + info.AddExample( "image.png 25% thumbnail.png", "Convert image to relative size (25% of original)",