/stuff/notes/exif.cgi
#!/bin/bash
FN=${REQUEST_URI##*/}
FN=${FN%.info}.jpg
URI=http://${SERVER_NAME}${REQUEST_URI}
URI=${URI%exif/*}${URI#*exif/}
cat $FN | $DOCUMENT_ROOT/odds/exiftool/exiftool - > /tmp/$$.einfo
cat <<EOF
Content-Type: text/html; charset=utf-8
<!DOCTYPE html>
EOF
grep 'Document Name' /tmp/$$.einfo | \
sed "s![^:]*: *!!; s!^!<title>!; s!\$!</title>!;"
cat <<EOF
<style type="text/css">
html { font: 1em/1.3em Georgia }
body { max-width: 90ex; margin: 3em auto }
h1 { font-size: 1.7em; font-weight: normal }
h1 a { color: #000; text-decoration: none }
h1, p.image, address { text-align: center }
p { margin: 1.3em 0 }
</style>
EOF
grep 'Document Name' /tmp/$$.einfo | \
sed "s![^:]*: *!!; s!^!<h1><a href=\"${URI}\">!; s!\$!</a></h1>!;"
echo '<p>'
grep 'Artist' /tmp/$$.einfo | \
sed 's![^:]*:!<strong>Artist</strong>:!; s!$!<br />!'
grep 'Image Description' /tmp/$$.einfo | \
sed 's![^:]*:!<strong>Description</strong>:!; s!$!<br />!'
grep 'Image History' /tmp/$$.einfo | \
sed 's![^:]*:!<strong>History</strong>:!; s!$!<br />!'
grep 'Copyright' /tmp/$$.einfo | \
sed 's![^:]*:!<strong>Copyright</strong>:!; s!$!<br />!'
rm /tmp/$$.einfo
echo '</p>'
echo "<p class="image"><img src=\"${URI}\" alt=\"[the image]\"></p>"
echo '<address>'
echo '<a href="http://inamidst.com/sbp/">Sean B. Palmer</a>'
echo '</address>'
# EOF