From 307224fc261b4bf0aaf287bbc70dbcc61ee9aeba Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 23 Apr 2026 14:02:24 +0000 Subject: [PATCH] 4-seasons: fix silent exit in grey-frame filter (read + set -e) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When SEASONS_GREY_STDDEV_MIN is enabled, ImageMagick's convert outputs the stddev/mean values without a trailing newline. read exits 1 on EOF- without-newline even when it successfully populated the variables. With set -euo pipefail this kills the script silently on the very first image that enters the grey-filter code path — producing the observed symptom: script stops after "Images found:" with no error and no video. Fix: append || true so read's EOF exit code is absorbed. The variables are still set correctly; only the exit code changes. https://claude.ai/code/session_01U29A8NpgJ41tboiggZNmk8 --- 4-seasons.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/4-seasons.sh b/4-seasons.sh index 04aaba0..0cad26f 100755 --- a/4-seasons.sh +++ b/4-seasons.sh @@ -118,7 +118,7 @@ for img in "${all_images[@]}"; do if [ "$fsize" -lt "$LARGE_BYTES" ]; then read -r stddev mean < <(convert "$img" -colorspace Gray \ -format "%[fx:int(standard_deviation*255)] %[fx:int(mean*255)]" \ - info: 2>/dev/null || echo "255 128") + info: 2>/dev/null || echo "255 128") || true if [ "${stddev:-255}" -lt "$GREY_MIN" ] && [ "${mean:-0}" -gt "$GREY_DARK_FLOOR" ]; then ((grey++)) || true; continue fi