TinyJPG
images jpg or jpeg compressed and watcher fsnotify
Install / Use
/learn @OrlovEvgeny/TinyJPGREADME
TinyJPG Filesystem watcher and image compress
JPEG image compress watcher based Filesystem event notification github.com/rjeczalik/notify
Example compress quality 82%
original before size 1.47 MB (1,536,181 bytes) | compressed after 277.56 KB (284,223 bytes)
------------- | -------------
| 
Install binary
Installation dependency
~ $ apt install libmagickwand-dev imagemagick
Install TinyJPG for v0.0.9:
curl -L https://raw.githubusercontent.com/OrlovEvgeny/TinyJPG/master/tinyjpg_install.sh | sh -s - v0.0.9
If you prefer Ansible:
tasks:
- name: TinyJPG installed
sudo: yes
shell: "curl -L https://raw.githubusercontent.com/OrlovEvgeny/TinyJPG/master/tinyjpg_install.sh | sh -s - v0.0.9"
Edit config File
~ $ vim /etc/tinyjpg/config.yml
##
# TinyJPG v0.0.9
#
# worker - maximum amount workers, Default value - 5
# verbose - verbose log, Default value - true
# worker_buffer - maximum buffer queue workers, Default value - 100
# event_buffer - maximum buffer an event reported by the underlying filesystem notification subsystem, Default value - 100
##
general:
worker: 5
worker_buffer: 100
event_buffer: 300
verbose: false
error_log: '/var/log/tinyjpg/error.log'
info_log: '/var/log/tinyjpg/info.log'
###
# Image compress settings
#
# paths - directories you need to track
# prefix - prefix of files to be processed, Default value all files - *
# example use
#
# prefix:
# - 'orig'
# - 'medium'
# - 'full'
#
# quality - This param image quality level in percentage.
# If the original image quality is lower than the quality of the parameter - quality
# the image will not be processed
###
compress:
paths:
- '/home/www/example.com/uploads'
- '/home/www/site.org/uploads'
prefix:
- '*'
quality: 82
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 -config=/etc/tinyjpg/config.yml
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 -config=/etc/tinyjpg/config.yml
deprecated
or use CLI mode
# deprecated
~ $ tinyjpg -path=/home/www/example.com/images -worker=10
Args:
- path - required. Path to watch new files, default /home/www
- 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:
Related Skills
node-connect
351.8kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
xurl
351.8kA CLI tool for making authenticated requests to the X (Twitter) API. Use this skill when you need to post tweets, reply, quote, search, read posts, manage followers, send DMs, upload media, or interact with any X API v2 endpoint.
frontend-design
110.9kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
351.8kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
