JPEG optimizing web app
- Plain HTML/CSS/JavaScript frontend
- Traditional style, and simple
- Multiple files/directories selection
"Add files" or "Add a directory" to select files. Also can add by drag&drop files to file list.
"Process" to execute optimizing.
File saving dialog will open, and save processed file.
Note
For docker deployment, required only docker engine (cli).
For docker-compose, docker compose
required additionally.
- Python3 (2 or lower is unsupported)
- Python pip
- mozjpeg
- Python venv (for systemd)
- systemd (for systemd)
Just only type this.
docker compose up
Just only build, then run.
docker build -t mozjpeg-webui .
docker run --rm -it -p 8000:8000 mozjpeg-webui
# Install required packages for build
sudo apt install cmake nasm
# Get mozjpeg source
## via git
git clone https://github.com/mozilla/mozjpeg.git --depth 1 -b v4.1.1
cd mozjpeg
### === or ===
## via wget
wget -O - https://github.com/mozilla/mozjpeg/archive/refs/tags/v4.1.1.tar.gz | tar -xzv -C ./
cd mozjpeg-4.1.1
# Build and install mozjpeg
mkdir build && cd build
cmake -G"Unix Makefiles" -DPNG_SUPPORTED=0 ../
sudo make -j5 install
## -jn option is number of jobs to run simultaneously
## -j<thread_count+1> is recommended
Any problems of build? Please see official reference.
Note
If you need, work in virtual environment.
pip install fastapi uvicorn jinja2 python-multipart
# via requirements.txt
pip install -r assets/requirements.txt
cd src
python3 main.py
Now app will be available on: http://localhost:8000
Please done Build and install mozjpeg before.
Note
Python virtual environment will be created automatically.
# Root permission required
sudo ./systemd-setup.sh
mozjpeg-webui
service will be available on systemd.
systemctl start mozjpeg-webui # Start
systemctl stop mozjpeg-webui # Stop
systemctl enable mozjpeg-webui # Set auto start
systemctl disable mozjpeg-webui # Unset auto start