Skip to content

Instantly share code, notes, and snippets.

@mrcodetastic
Created March 2, 2019 20:11
Show Gist options
  • Save mrcodetastic/01b4d20d600fc8260b0011ac31e21646 to your computer and use it in GitHub Desktop.
Save mrcodetastic/01b4d20d600fc8260b0011ac31e21646 to your computer and use it in GitHub Desktop.
Windows Powershell to recurse through all directories and re-compress/ JPEGs
# Re-compress / Optimise all JPEGs in place (80% quality = approx. 70% disk saving, with little noticeable difference )
# NOTE: This will over-write the original JPED file! Also change the path to your executable.
# Requires jpegoptim: https://github.com/XhmikosR/jpegoptim-windows/releases
Get-ChildItem -Recurse -File -Include *.jpg,*.JPEG | Foreach {C:\<CHANGE_THIS_PATH>\jpegoptim --max=80 $_.fullname}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment