Forked from this, which is a fork of: this
This will be POSIX sh compliant as soon as I fix the semaphore implementation.
Recommend also using Pingo but it appears to be closed source.
- Pass shellcheck
- Use functions to make parallelization easier
- Don't reuse the same filenames so we can parallelize
- Use fd instead of find so walking files is a lot faster.
- Only use one
fd
orfind
and optimize both types of images in the same loop. - Use
file(1)
to detect file type and skip empty files. - Detect cpu count
- Only spawn N processes and make sure N are always running when there are images to optimize
- Detect if fd is installed and fall back to
find
if it isn't. - Add support for gif and other file types
- Detect if the prerequisite programs are installed
- Install prerequisites if they are not installed