Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
andyone committed Sep 10, 2021
1 parent b624966 commit 34adafb
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 2 deletions.
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
```

Expand Down
10 changes: 8 additions & 2 deletions rsz.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down Expand Up @@ -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")
Expand All @@ -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)",
Expand Down

0 comments on commit 34adafb

Please sign in to comment.