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