From d8f0cdf6f225ff0e3b16bded29739ba21255aa30 Mon Sep 17 00:00:00 2001 From: Iain Lane Date: Thu, 3 Jun 2021 10:41:12 +0100 Subject: [PATCH] config: Move setUseOptipng call after we determine if optipng is available Currently we tell AsCompose to use optipng just based on the value of the feature flag. AsCompose will respect what we tell it without further checking. If optipng is in fact not available then we'll crash later on when we first try to use it. Fix this by setting the flag *after* we check if optipng is installed. --- src/asgen/config.d | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/asgen/config.d b/src/asgen/config.d index 7ed01d1..76cd598 100644 --- a/src/asgen/config.d +++ b/src/asgen/config.d @@ -611,7 +611,6 @@ public: } // check if we need to disable features because some prerequisites are not met - Globals.setUseOptipng (feature.optipng); if (feature.optipng) { if (optipngBinary.empty) { feature.optipng = false; @@ -620,6 +619,7 @@ public: logDebug ("Using `optipng`: %s", optipngBinary); } } + Globals.setUseOptipng (feature.optipng); if (feature.screenshotVideos) { if (ffprobeBinary.empty) { feature.screenshotVideos = false;