Files
scripts-collection/media/webpconvert.sh
kokopi-dev 9141f3bc0a add:media
2026-04-05 00:36:32 +09:00

14 lines
332 B
Bash
Executable File

#!/bin/bash
# TODO add resource options like ogcard, yt-thumbnail, etc
# convert to golang or rust probably for better ux on cli
DEFAULT_WIDTH=1200
if [ "$#" -lt 2 ] || [ "$#" -gt 3 ]; then
echo "Usage: $0 <input> <output> [width]"
exit 1
fi
WIDTH="${3:-$DEFAULT_WIDTH}"
magick "$1" -resize "${WIDTH}x>" -quality 85 "$2"