Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- ## Setup your cards, one per line in a file named 'cards.txt'
- outdir="output"
- echo "Downloading `wc -l cards.txt` cards"
- while read line
- do
- wget "http://mtgimage.com/card/$line.jpg"
- done < cards.txt
- echo "Download complete"
- mkdir $outdir
- echo "Creating printable sheets in $outdir"
- image_files=(*.jpg)
- n=9 # number of images per sheet
- for ((i=0; i < ${#image_files[@]}; i+=n)); do
- montage -geometry 709x1006+20+20 -background "#ffffff" "${image_files[@]:i:n}" $outdir/output-"$i".jpg
- convert $outdir/output-"$i".jpg -bordercolor '#ffffff' -border 75x124 -gravity center $outdir/output-"$i".jpg
- done
- echo "Done."
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement