#!/usr/bin/env sh
which inkscape
test $? -eq 0 || {
	echo "missing inkscape"
	exit 1
}
if=fileicons.svg
#~ iconsize=16 # in px
for iconsize in $(echo 64 ); do # in px, assuming its a square, a = iconsize; smaller than 64 is unreadable 
	for ofi in $(echo epub html pdf other); do
	
		# output filename
		of="new-"${ofi}"-"${iconsize}".png"
		# needs group obkect to be renamed accordingly and layer visible
		# option `--verb=LayerShowAll` works with GUI only, possibility: split SVG in separate files beforhand
		inkscape --without-gui --file=${if} \
			--export-id-only --export-id=${ofi}"-prod" \
			--export-background-opacity=0 --export-area-page \
			--export-png=${of} --export-width=${iconsize} --export-height=${iconsize}

	done
done
