Skip to content

Commit

Permalink
Timeout flag conversion after 30 seconds.
Browse files Browse the repository at this point in the history
The conversion of the flags of Freeciv's bundled nations' from SVG can
result in an eternal loop on some systems. Add a time out to stop it.
  • Loading branch information
kvilhaugsvik committed Jul 30, 2020
1 parent 36dc40c commit a465e91
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/freeciv-img-extract/sync.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ echo "converting flag .svg files to .png and .webp ..." &&
(for svgfile in $(find "${FREECIV_DIR}"/data/flags/*.svg); do
name="$(basename "$svgfile")"
pngfile="${FLAG_DEST}/${name/%.svg/-web.png}"
convert -density 80 -resize 180 "$svgfile" "${pngfile}" ||
timeout 30 convert -density 80 -resize 180 "$svgfile" "${pngfile}" ||
>&2 echo " ERROR converting ${svgfile} to ${pngfile}"
[[ -f "${pngfile}" ]] && cwebp -quiet -lossless "${pngfile}" -o "${pngfile/%.png/.webp}" ||
>&2 echo " ERROR packing ${pngfile} to ${pngfile/%.png/.webp}"
Expand Down

0 comments on commit a465e91

Please sign in to comment.