#!/bin/bash #apt install imagemagick #brew install imagemagick for img in "$@"; do width=$(identify -format "%w" "$img") if (( width > 800 )); then echo "Resizing: $img ($width px wide)" convert "$img" -resize 800x "$img" else echo "Skipping: $img (already $width px wide or smaller)" fi done