#!/bin/sh
#
# Generate the image with the IM version number
#
# This is done in every sub-directory so I can check what verson of Im was
# used to generate the images on that page.
#
# Anthony Thyssen  <A.Thyssen@griffith.edu.au>

# This could be exected in either top level or the sub-directory
[ -f ./generate_options ]  && . ./generate_options
[ -f ../generate_options ] && . ../generate_options
[ -f ../../generate_options ] && . ../../generate_options

gif=version.gif
echo "Generating IM \"$gif\" image"
#identify -version | head -1 | cut -d\  -f2-4 | tr -d '\012' | \
convert -list configure | egrep 'LIB_VERSION_NUMBER|RELEASE_DATE' |\
  tr -d '\012' | sed 's/LIB[^ ]* /IM v/;s/REL.* / /;s/,/./;s/,/./;s/,/-/' |\
    convert -background $page_bg_color -pointsize 18 label:@-  $gif
chmod 644 $gif

# handle any backup ourselves very quietly
if [ -f _$gif ]; then
  rm _$gif
fi
