Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/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
You can’t perform that action at this time.