4-seasons: fix silent exit in grey-frame filter (read + set -e)
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
This commit is contained in:
+1
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user