#!/bin/sh
cd work/out

mkdir output
mkdir audiomedia


for i in *.tif 
do
  convert -units pixelsperinch $i -resample 150 audiomedia/$i.jpg
  convert $i -quality 95% output/$i.jpg
done

rem 300dpi mag
cd output
for i in *.jpg
do
  convert $i $i.pdf
done

rm *.jpg
pdftk *.pdf cat output ../../../mag.pdf
rm *.pdf
cd ..


rem Tablet
cd audiomedia
for i in *.jpg
do 
  convert $i $i.pdf
done

rm *.jpg
pdftk *.pdf output ../../../audiomedia.pdf
rm *.pdf 

