tinyjpg

command module
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2018 License: MIT Imports: 10 Imported by: 0

README

TinyJPG Filesystem watcher and image compress

Go Report Card Build Status Maintainability

JPEG image compress watcher based Filesystem event notification github.com/rjeczalik/notify

screenshot

Install binary

Installation dependency

~ $ apt install libmagickwand-dev imagemagick

for amd64

~ $ curl -L https://github.com/OrlovEvgeny/TinyJPG/releases/download/v0.0.7-beta/tinyjpg-amd64 --output /usr/local/bin/tinyjpg

or i386

~ $ curl -L https://github.com/OrlovEvgeny/TinyJPG/releases/download/v0.0.7-beta/tinyjpg-386 --output /usr/local/bin/tinyjpg

permission for execution

~ $ chmod +x /usr/local/bin/tinyjpg

check that everything is fine

~ $ tinyjpg -help

    Usage of build/tinyjpg:
      -config string
            config file path
      -event_buffer int
            buffer an event reported (default 300)
      -path string
            uploads folder path, default - /home/www (default "/home/www")
      -quality int
            image quality level in percentage (default 82)
      -worker int
            maximum amount workers (default 5)
      -worker_buffer int
            maximum buffer queue workers (default 500)

Use

I recommend using supervisor

example config

~ $ vim /etc/supervisor/conf.d/tinyjpg.conf

write

[program:tinyjpg]
command=/usr/local/bin/tinyjpg -path=/home/www/example.com/images -verbose=true -worker=10
environment=ENVIRONMENT=production
autorestart=true
user=root
redirect_stderr=true
stderr_logfile=/var/log/tinyjpg/log.err.log
stdout_logfile=/var/log/tinyjpg/log.out.log
~ $ mkdir -p /var/log/tinyjpg
~ $ service supervisor restart

or use Tmux

~ $ tinyjpg -path=/home/www/example.com/images -verbose=true -worker=10

Args:

  • path - required. Path to watch new files, default /home/www
  • verbose - optional. Verbose log out, default true
  • worker - optional. Amount start workers process, default 5

Build Source

For compilation you need to install Golang1.8

~ $ apt install libmagickwand-dev imagemagick
~ $ git clone https://github.com/OrlovEvgeny/TinyJPG && cd TinyJPG
~ $ go get -u github.com/rjeczalik/notify
~ $ mkdir build && go build -o ./build/tinyjpg *.go
~ $ mv /build/tinyjpg  /usr/local/bin/tinyjpg

permission for execution

~ $ chmod +x /usr/local/bin/tinyjpg

License:

MIT

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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