Last active
October 11, 2015 19:58
-
-
Save mineo/3911951 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -e | |
if [ $# -ne 2 ]; then | |
echo Usage: $0 mbid booklet-file.pdf | |
exit 1 | |
fi | |
type convert >/dev/null 2>&1 | |
if [ $? -ne 0 ]; then | |
echo "You need convert (part of imagemagick) to use this script." | |
exit 1 | |
fi | |
mbid=$1 | |
pdffile=$2 | |
folder=${pdffile%.pdf} | |
mkdir "$folder" | |
echo Converting, this may take a while... | |
convert -density 300 -quality 100 "$pdffile" "${folder}/"booklet.jpg | |
for i in "${folder}/"*; do | |
echo -e "$mbid\t$i\tBooklet" >> coverartfile | |
done | |
echo Done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment