3 # Description: Resize images in a directory to screen resolution with imgp
5 # Dependencipes: imgp - https://github.com/jarun/imgp
8 # 1. Set res to avoid the desktop resolution prompt each time
9 # 2. MINSIZE is set to 1MB by default, adjust it if you want
10 # 3. imgp options used:
12 # c - convert PNG to JPG
13 # k - skip images matching specified hres/vres
15 # Shell: POSIX compliant
16 # Author: Arun Prakash Jana
18 # set resolution (e.g. 1920x1080)
21 # set minimum image size (in bytes) to resize (default: 1MB)
22 MINSIZE="${MINSIZE:-1048576}"
24 if [ -z "$res" ]; then
25 printf "desktop resolution (hxv): "
29 if [ -n "$res" ] && [ -n "$MINSIZE" ]; then
30 imgp -ackx "$res" -s "$MINSIZE"