From d580d7639726d91c57fda7de486ff603ea86f832 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Paul=20H=C3=A4nsch?= Date: Sat, 2 Oct 2021 21:54:33 +0200 Subject: [PATCH 1/1] allow background color --- thumbnail.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/thumbnail.sh b/thumbnail.sh index 4a6f828..a2686be 100644 --- a/thumbnail.sh +++ b/thumbnail.sh @@ -4,7 +4,8 @@ include_thumbnails="$0" gen_thumb(){ - local file="$1" thumb="$2" tmp="${TMPDIR:-/tmp}/serve0tmp_$$/" lenght n + local file="$1" thumb="$2" bgcolor="${3:-#000000}" + local tmp="${TMPDIR:-/tmp}/serve0tmp_$$/" lenght n if [ "${file%.part}" = "${file}" -a ! -s "$thumb" -a -s "$file" ] && mkdir "$tmp"; then length="$( ffprobe -show_entries stream=duration "$file" 2>&- )" @@ -17,6 +18,7 @@ gen_thumb(){ done montage "$tmp"/thumb_[0-9].jpg \ + -background "$bgcolor" \ -tile 10x1 -geometry 320x180+0+0 \ -interlace line -quality 85 "$thumb" rm -r -- "${tmp}" -- 2.39.2