From f0422ed330506fd1a382afb625f886bcf7158822 Mon Sep 17 00:00:00 2001 From: Hugo Villeneuve Date: Fri, 6 Oct 2023 16:13:52 -0400 Subject: [PATCH] Support new background layer name --- fgen.sh | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/fgen.sh b/fgen.sh index 64baf44..ea04217 100755 --- a/fgen.sh +++ b/fgen.sh @@ -9,7 +9,7 @@ set -e PROG_NAME=$(basename $0) # Set default values -main_layer="Layer 558" +bg_layer_name="background" # Pour conversion vidéo: fps=8 @@ -162,16 +162,21 @@ if [ ${trames} -eq 1 ]; then ${SED} -i -e /label:,.*/d ${layers} # Extract global frame size: - size=$(get_size "${main_layer}") + size=$(get_size "${bg_layer_name}") - log_dbg "CANVAS SIZE=${size}" + log_dbg "Background size: ${size}" + + if [ x"${size}" = x"" ]; then + echo "Error: background layer not found" + exit 1 + fi + + # Remove background line: + ${SED} -i -e /label:${bg_layer_name},.*/d ${layers} # Create background frame: convert -size ${size} xc:none ${dest}/background.png - # Remove first line (Layer 558): - ${SED} -i -e '1d' ${layers} - # Will start at frame 2 at first loop iteration f=1 -- 2.20.1