Skip to content

Shell script to recursively optimize all image in the current directory. WARNING: THIS OVERWRITES YOUR ORIGINALS AND REMOVES METADATA!

Notifications You must be signed in to change notification settings

mjc/optimizeimages.sh

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 

Repository files navigation

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

About

Shell script to recursively optimize all image in the current directory. WARNING: THIS OVERWRITES YOUR ORIGINALS AND REMOVES METADATA!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages