#! /bin/bash # Bash shell script to extract bounding box information from a GIFF image # The script needs the following - /bin/awk, /usr/bin/giftopnm and # /usr/bin/pnmtops - which are distributed with most Linux distributions # # Usage is as follows : gifbb graphic.gif # This results in a file called graphic.gif.bb # # First written : Dr. Miguel A Blanco # Quantum Chemistry Group, Universidad de Oviedo, Spain # miguel@carbono.quimica.uniovi.es # if [ $# = "0" ] ; then giftopnm | pnmtops -noturn 2> /dev/null | \ awk '/^%[%]*BoundingBox/ {print; exit}' ; else for gif in $* ; do giftopnm $gif | pnmtops -noturn 2> /dev/null | \ awk '/^%[%]*BoundingBox/ {print; exit}' > $gif.bb ; done ; fi