Skip to content

Instantly share code, notes, and snippets.

@rriemann
Created February 9, 2018 00:03
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save rriemann/bf39c675e69c552ffc6b4b844df02627 to your computer and use it in GitHub Desktop.
convert pictures in for loop
#!/usr/bin/env bash
find . -print0 | while read -d $'\0' file
do
convert -size 800x800 ${file} -resize 800x800 +profile '*' ${file%\.*}_big.jpg
convert -size 200x150 ${file} -resize 200x150 +profile '*' ${file%\.*}_small.jpg
echo "<a class=\"zoom\" rel=\"group02\" title=\"${file}\" href=\"{relocatable: /referenzen/${file%\.*}_big.jpg}\"><img src=\"{relocatable: /referenzen/${file%\.*}_small.jpg}\" alt=\"\" /></a>"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment