From 9781a4723cbe5bd4d6bd7b5048d830821dda23ef Mon Sep 17 00:00:00 2001 From: Bill Kendrick Date: Wed, 14 Oct 2020 23:44:14 -0700 Subject: [PATCH] Ignore & clean up failed SVG thumbnails When building Tux Paint, ImageMagick's `convert` might fail to generate thumbnail PNGs for some Starter SVG images (e.g., "manatee.svg"), with a "too many bezier coordinates" error. This did not happen before, and does not happen with newer versions of ImageMagick; there was a regression fixed in 2018: https://github.com/ImageMagick/ImageMagick/issues/1069 However, it's occurring in Ubuntu 20.04 'focal' (I've got version "6.9.10-23 Q16 x86_64 20190101"). Therefore, as a quick-fix, simply ignoring errors from `convert`, and removing the (bogus) PNG thumbmail image, and allowing the `make` process to proceed. Tux Paint will simply open the SVG and generate a thumbnail to display on the screen when the "New" dialog is brought up. --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index d1efbea8c..be2d3c7cb 100644 --- a/Makefile +++ b/Makefile @@ -720,7 +720,7 @@ $(THUMB_STARTERS): convert $(CONVERT_OPTS) obj/tmp_$(notdir $(STARTER_NAME)).png $@ ; \ rm obj/tmp_$(notdir $(STARTER_NAME)).png ; \ else \ - convert $(CONVERT_OPTS) $(STARTER_NAME) $@ ; \ + convert $(CONVERT_OPTS) $(STARTER_NAME) $@ || ( echo "IT FAILED" ; rm -v $@ ) ; \ fi $(INSTALLED_THUMB_STARTERS): $(DATA_PREFIX)/%: % @@ -775,7 +775,7 @@ TEMPLATE_NAME=$(or $(wildcard $(subst templates/.thumbs,templates,$(@:-t.png=.sv $(THUMB_TEMPLATES): @echo -n "." @mkdir -p templates/.thumbs - @convert $(CONVERT_OPTS) $(TEMPLATE_NAME) $@ ; \ + convert $(CONVERT_OPTS) $(TEMPLATE_NAME) $@ || ( echo "IT FAILED" ; rm -v $@ ) ; \ $(INSTALLED_THUMB_TEMPLATES): $(DATA_PREFIX)/%: % @install -D -m 644 $< $@