tinifier

module
v1.0.3-0...-6439a4b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 26, 2020 License: MIT

README

Logo

CLI tool for images compressing

Release version Project language Build Status Coverage Go Report Image size License Chat

This tool uses tinypng.com API endpoint for compressing your local jpg/png images (it supports parallel jobs):

API key can be passed in environment variable named TINYPNG_API_KEY

Recursive (deep) directories walking is not supported

💻 Installing

WIP

Download latest binary file from releases page or use docker image.

🔥 Usage example

tinypng.com API key is required. You can get own API key by pressing link "login" on service main page.

Compress single image:

$ tinifier compress -k 'YOUR-API-KEY-GOES-HERE' ./image.png

Compress all png images in some directory and 2 another images:

$ tinifier compress -k 'YOUR-API-KEY-GOES-HERE' -e png ./images-directory ./image-1.png ./image-2.png

Compress all images in some directory using 20 threads:

$ tinifier compress -k 'YOUR-API-KEY-GOES-HERE' -e png -e jpg -e PNG,JPG -t 20 ./images-directory

🐳 Using docker

Compress all images in current directory:

$ docker run --rm -ti \
    -u "$(id -u):$(id -g)" \
    -v "$(pwd):/rootfs:rw" \
    -w /rootfs \
    tarampampam/tinifier compress -k 'YOUR-API-KEY-GOES-HERE' .

or

$ docker run --rm -ti \
    -u "$(id -u):$(id -g)" \
    -v "$(pwd):/rootfs:rw" \
    -w /rootfs \
    -e 'TINYPNG_API_KEY=YOUR-API-KEY-GOES-HERE' \
    tarampampam/tinifier compress .

Testing

For application testing and building we use built-in golang testing feature and docker-ce + docker-compose as develop environment. So, just write into your terminal after repository cloning:

$ make test

Or build binary file:

$ make build

Releasing

WIP

Changelog

Release date Commits since latest release

Changes log can be found here.

Support

Issues Issues

If you will find any package errors, please, make an issue in current repository.

License

This is open-sourced software licensed under the MIT License.

Directories

Path Synopsis
cmd
internal
pkg
tinypng
Package tinypng is `tinypng.com` API client implementation.
Package tinypng is `tinypng.com` API client implementation.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL