]> git.lizzy.rs Git - dirlistozxa.git/blob - gen-thumbs
Hide all files and folders that begin with `.`
[dirlistozxa.git] / gen-thumbs
1 #!/bin/bash
2
3 # Generates thumbs
4
5 if [ "$1" != "" ]; then
6         target_file=.thumbs/$(basename -- "$1")
7         if [ "$1" -nt "$target_file" ]; then
8                 echo "update $target_file"
9                 mogrify -path .thumbs/ -auto-orient -thumbnail 128x128 -quality 90% "$1"
10         fi
11 else
12         mkdir -p .thumbs
13         find -not -path "./.thumbs/*" \( -iname "*.png" -or -iname "*.jpg" -or -iname "*.jpeg" -or -iname "*.jfif" -or -iname "*.gif" -or -iname "*.webp" \) | parallel -j$(nproc) "$0" {}
14 fi