Skip to content

Instantly share code, notes, and snippets.

@rriemann
Created May 30, 2012 13:26
Show Gist options
  • Save rriemann/2836323 to your computer and use it in GitHub Desktop.
Save rriemann/2836323 to your computer and use it in GitHub Desktop.
Parallel shell loop using prll
http://prll.sourceforge.net/
source ~/bin/prll.sh
myfn() {
mkdir -p /tmp/thumbs/${1%/*};
[ ! -f "/tmp/thumbs/${1}" ] && convert -define jpeg:size=1500x1200 "$1" -quality 75 -auto-orient -thumbnail 1366x768\> "/tmp/thumbs/${1}"
}
#myfn for square thumbnails:
# http://superuser.com/questions/275476/square-thumbnails-with-imagemagick-convert
myfn() {
mkdir -p /tmp/thumbs/${1%/*};
[ ! -f "/tmp/thumbs/${1}" ] && convert -define jpeg:size=400x400 "$1" -quality 75 -thumbnail 200x200\^ -gravity center -auto-orient -extent 100x100\> "/tmp/thumbs/${1}"
}
# fancybox gallery
for file in *.JPG; do 2012-11-13
echo "<a class="fancybox" href=\"$file\" data-fancybox-group=\"gallery\" title=\"\"><img src=\"thumbs/$file\" alt=\"\" /></a>"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment