Skip to content

Commit 6641e35

Browse files
committed
Shrink large images to at most 1024x1024 pixels
Looks for files over 300k, with current height or width over 2000 pixels, and resizes those to up to 1024x1024. Uses ImageMagick: $ find . -type f -size +300k -exec file \{\} \;| awk -F: '{if ($2 ~/image/) print $1}'| while IFS= read -r file_path; do if (( $(identify -ping -format '%w' "$file_path") > 2000 )) || (( $(identify -ping -format '%h' "$file_path") > 2000 )); then identify -ping -format '%w %h %f' "$file_path";echo;mogrify -resize 1024x1024\> "$file_path";fi;done (Should really ignore the SVG files) Based on earlier suggestion by Bastian.
1 parent 39ef69c commit 6641e35

28 files changed

static/img/2025/2025-08-25-TA1.png

-2.7 MB
Loading

static/img/2025/2025-08-25-TA4.png

-2.98 MB
Loading

static/img/2025/2025-08-25-TA5.png

-4.65 MB
Loading
-1.04 MB
Loading
-914 KB
Loading
-2.64 MB
Loading
-3.95 MB
Loading
-4.65 MB
Loading
-5.43 MB
Loading
-4.11 MB
Loading

0 commit comments

Comments
 (0)