Use better framed picture when available

This commit is contained in:
2018-08-08 12:05:07 +02:00
parent 984a8f1f08
commit 43cf59264f

View File

@@ -360,15 +360,21 @@ for scene in ${SCENES}; do
mv "${DATA_DIRECTORY}/scenes/${scene}/${scene}_cpu.blend" "${DATA_DIRECTORY}/scenes/${scene}/${scene}.blend"
# Tweak image.
if true; then
input="${DATA_DIRECTORY}/scenes/${scene}/${scene}.png"
if [ -f "${DATA_DIRECTORY}/scenes/${scene}/${scene}_frame.png" ]; then
input="${DATA_DIRECTORY}/scenes/${scene}/${scene}_frame.png"
else
input="${DATA_DIRECTORY}/scenes/${scene}/${scene}.png"
fi
input_we=`basename "${input%.*}"`
input_we="${input_we//_frame/}"
output_scaled="${STORAGE_DIRECTORY}/${input_we}_scaled.png"
output_compo="${STORAGE_DIRECTORY}/${input_we}.png"
"${CONVERT_CMD}" ${CONVERT_TOOL} "${input}" -resize ${IMAGE_WIDTH}x${IMAGE_HEIGHT} "${output_scaled}"
"${CONVERT_CMD}" ${CONVERT_TOOL} ${BACKGROUND_IMAGE} "${output_scaled}" -gravity center -composite "${output_compo}"
mv "${output_compo}" "${input}"
mv "${output_compo}" "${input//_frame/}"
rm ${output_scaled}
fi
rm -f "${DATA_DIRECTORY}/scenes/${scene}/${scene}_frame.png"
done
################################################################################