From d63efd525d77a66b7917ac20dda5da501408da6f Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Mon, 28 Sep 2015 11:45:34 +0200 Subject: [PATCH] Added set-jpeg-comment.sh --- set-jpeg-comment.sh | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100755 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 -- 2.39.5