Skip to content

Commit

Permalink
Merge pull request #2 from essentialkaos/develop
Browse files Browse the repository at this point in the history
Version 0.0.2
  • Loading branch information
andyone authored Sep 10, 2021
2 parents 51f89f8 + b907b63 commit cec947f
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 2 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,35 @@ jobs:
working-directory: ${{env.SRC_DIR}}
run: make all

Hadolint:
name: Hadolint
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Check dockerfiles with Hadolint
uses: essentialkaos/hadolint-action@v1
with:
files: Dockerfile

DockerBuild:
name: Docker Build Check
runs-on: ubuntu-latest

needs: Hadolint

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build Docker image
run: |
docker build -f Dockerfile -t rsz .
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 cec947f

Please sign in to comment.