#!/bin/sh

root=$1
shift


function get_width() {
    identify $1 | awk '{print $3}' | sed 's/x.*//'
}

function get_height() {
    identify $1 | awk '{print $3}' | sed 's/.*x//'
}

echo '@import "numbers.css";' > images-css/$root.css

for image
do
    width=`get_width $image`
    height=`get_height $image`

    echo "
graphic[fileref=\"$image\"]:after {
    display: block;
    content: url('http://localhost/java/jini/newtut/$image');
/*    height: ${height}px;
    width: ${width}px;
    background-repeat: no-repeat;
    background-position : bottom right;
*/
    margin-left: auto;
    margin-right: auto;
}

" >> images-css/$root.css

done


