Skip to content

Latest commit

 

History

History
22 lines (18 loc) · 1.15 KB

README.md

File metadata and controls

22 lines (18 loc) · 1.15 KB

Script to recursively optimize all images in current directory

THIS WILL OVERWRITE YOUR ORIGINAL IMAGES AND STRIP METADATA. MAKE A SNAPSHOT.

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.

TODO:

  • 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 or find 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