--- /dev/null
+#!/bin/bash
+
+
+set -e
+set -u
+
+
+usage() {
+ cat <<EOF
+Usage: ${0} <IMAGE_FILE> [COMMENT]
+
+EOF
+}
+
+if [[ "$#" -lt 1 ]] ; then
+ echo -e "No image file given.\n" >&2
+ usage >&2
+ exit 1
+fi
+
+IMAGE_FILE="${1}"
+shift
+
+if type -t rdjpgcom >/dev/null ; then
+ :
+else
+ cat >&2 <<-EOF
+ Executable rdjpgcom not found.
+
+ Please install package libjpeg-progs (Debian/Ubuntu) or media-libs/libjpeg-turbo (Gentoo).
+
+ EOF
+ exit 5
+fi
+
+if [[ ! -f "${IMAGE_FILE}" ]] ; then
+ echo -e "File '${IMAGE_FILE}' not found.\n" >&2
+ usage >&2
+ exit 1
+fi
+
+
+# vim: et ts=4 softtabstop