projects
/
fgen.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Abort on all errors
[fgen.git]
/
fgen.sh
diff --git
a/fgen.sh
b/fgen.sh
index
019e662
..
99bc69d
100755
(executable)
--- a/
fgen.sh
+++ b/
fgen.sh
@@
-3,13
+3,16
@@
# SPDX-License-Identifier: GPL-2.0
# Copyright (c) 2023 Hugo Villeneuve <hugo@hugovil.com>
# SPDX-License-Identifier: GPL-2.0
# Copyright (c) 2023 Hugo Villeneuve <hugo@hugovil.com>
+# Abort on all errors
+set -e
+
PROG_NAME=$(basename $0)
# Set default values
main_layer="Layer 558"
# Pour conversion vidéo:
PROG_NAME=$(basename $0)
# Set default values
main_layer="Layer 558"
# Pour conversion vidéo:
-fps=
3
+fps=
8
debug=0
debug=0
@@
-62,10
+65,9
@@
function get_frame_id()
frame=$(echo "${1}" | grep -e "label:[0-9]" | ${SED} "s/label:\([0-9]\+\),.*/\1/g")
if [ x"${frame}" = x"" ]; then
frame=$(echo "${1}" | grep -e "label:[0-9]" | ${SED} "s/label:\([0-9]\+\),.*/\1/g")
if [ x"${frame}" = x"" ]; then
- return 1
+ echo ""
else
echo "${frame}"
else
echo "${frame}"
- return 0
fi
}
fi
}
@@
-88,14
+90,18
@@
print_usage()
echo
echo "Options:"
echo " -d affiche les informations de debug"
echo
echo "Options:"
echo " -d affiche les informations de debug"
+ echo " -r nombre de trames par seconde (FPS)"
echo " -h affiche ce message d'aide"
}
echo " -h affiche ce message d'aide"
}
-while getopts "dh" flag ;do
+while getopts "dh
r:
" flag ;do
case ${flag} in
d)
debug="1"
;;
case ${flag} in
d)
debug="1"
;;
+ r)
+ fps="${OPTARG}"
+ ;;
h)
print_usage
exit 0
h)
print_usage
exit 0
@@
-155,8
+161,6
@@
size=$(get_size "${main_layer}")
log_dbg "CANVAS SIZE=${size}"
log_dbg "CANVAS SIZE=${size}"
-rm -f ${dest}/frame*.png
-
# Create background frame:
convert -size ${size} xc:none ${dest}/background.png
# Create background frame:
convert -size ${size} xc:none ${dest}/background.png
@@
-188,7
+192,7
@@
while read l; do
if [ x"${nf}" != x"" ]; then
log_dbg "New frame ID: ${nf}"
if [ x"${nf}" != x"" ]; then
log_dbg "New frame ID: ${nf}"
- convert -page +0+0 ${dest}/background.png ${files} -background none -layers merge ${dest}/f${nf}.png
+ convert -
colorspace sRGB -
page +0+0 ${dest}/background.png ${files} -background none -layers merge ${dest}/f${nf}.png
files=""
fi
files=""
fi