From: Frank Brehm Date: Mon, 28 Sep 2015 09:45:34 +0000 (+0200) Subject: Added set-jpeg-comment.sh X-Git-Url: https://git.uhu-banane.org/?a=commitdiff_plain;h=d63efd525d77a66b7917ac20dda5da501408da6f;p=my-stuff%2Fpython.git Added set-jpeg-comment.sh --- diff --git a/set-jpeg-comment.sh b/set-jpeg-comment.sh new file mode 100755 index 0000000..074bc68 --- /dev/null +++ b/set-jpeg-comment.sh @@ -0,0 +1,43 @@ +#!/bin/bash + + +set -e +set -u + + +usage() { + cat < [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