Skip to content

Instantly share code, notes, and snippets.

@mineo
Last active October 11, 2015 19:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mineo/3911951 to your computer and use it in GitHub Desktop.
Save mineo/3911951 to your computer and use it in GitHub Desktop.
#!/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