1
0

Auto-commit: 2025-10-31 08:58:35

This commit is contained in:
David Wuibaille
2025-10-31 08:58:36 +01:00
parent 7d94414992
commit 7cc3011354
1088 changed files with 193455 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
# 🖼️ Web Image Compression Script
## 🔧 What it does
- Recursively scans a folder for **PNG** and **WebP** images.
- Uses **ImageMagick (`magick`)** to recompress:
- PNG → strip metadata, set quality/compression, write temp file
- WebP → lossy re-encode with target quality
- **Replaces the original** only if the compressed file is **smaller**; otherwise keeps the original.
- Logs basic progress to the console.
## ✅ Prerequisites
- **ImageMagick** installed and `magick` available in **PATH**.
- Read/Write permissions to the target folder (supports UNC paths).
- The script **modifies files in place** → make a **backup** or test on a copy first.
- Run when the site load is low to avoid serving partially written files.