Verify the support for WebP images during the setup
authorAlexander Ebert <ebert@woltlab.com>
Tue, 15 Jun 2021 16:53:08 +0000 (18:53 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Tue, 15 Jun 2021 16:53:08 +0000 (18:53 +0200)
wcfsetup/install/files/lib/system/WCFSetup.class.php
wcfsetup/setup/lang/setup_de.xml
wcfsetup/setup/lang/setup_en.xml
wcfsetup/setup/template/stepShowSystemRequirements.tpl

index 5d6bc90e76c82decf70930dba27fc5e152c5eb2e..a3060e8e5b438b41f1adc9636b1171789a19ce13 100644 (file)
@@ -388,12 +388,12 @@ class WCFSetup extends WCF
             && ImagickImageAdapter::supportsAnimatedGIFs(ImagickImageAdapter::getVersion())
         ) {
             $system['graphicsLibrary'] = [
-                'result' => true,
+                'result' => ImagickImageAdapter::supportsWebp(),
                 'value' => 'ImageMagick',
             ];
         } elseif (GDImageAdapter::isSupported()) {
             $system['graphicsLibrary'] = [
-                'result' => true,
+                'result' => GDImageAdapter::supportsWebp(),
                 'value' => 'GD Library',
             ];
         }
index e40d475c27f5ac66b678d488d90c375738f36023..695a084df356858e545e13040b1f4937a68fe51f 100644 (file)
@@ -32,6 +32,7 @@
                <item name="wcf.global.systemRequirements.graphicsLibrary.requirement"><![CDATA[GD Library oder ImageMagick]]></item>
                <item name="wcf.global.systemRequirements.graphicsLibrary.description"><![CDATA[Die Grafikbearbeitungs-Bibliothek ist für die Verarbeitung und dynamische Generierung von Bildern zuständig. Es wird die GD Library oder alternativ ImageMagick benötigt.]]></item>
                <item name="wcf.global.systemRequirements.graphicsLibrary.notFound"><![CDATA[nicht gefunden]]></item>
+               <item name="wcf.global.systemRequirements.graphicsLibrary.webp"><![CDATA[Unterstützung für WebP-Grafiken fehlt]]></item>
                <item name="wcf.global.systemRequirements.active"><![CDATA[aktiviert]]></item>
                <item name="wcf.global.systemRequirements.notActive"><![CDATA[nicht aktiviert]]></item>
                <item name="wcf.global.systemRequirements.memoryLimit"><![CDATA[Zur Verfügung stehender Arbeitsspeicher]]></item>
index c89d9b97b6670049fa5c33680d07c5b9e8e00ca3..0581ec91530a90267af1ea937c7163a4c8400aca 100644 (file)
@@ -32,6 +32,7 @@
                <item name="wcf.global.systemRequirements.graphicsLibrary.requirement"><![CDATA[GD library or ImageMagick]]></item>
                <item name="wcf.global.systemRequirements.graphicsLibrary.description"><![CDATA[A graphics library is needed to read images and for the dynamic image generation. The GD library or alternatively ImageMagick is required.]]></item>
                <item name="wcf.global.systemRequirements.graphicsLibrary.notFound"><![CDATA[not found]]></item>
+               <item name="wcf.global.systemRequirements.graphicsLibrary.webp"><![CDATA[Support for WebP images missing]]></item>
                <item name="wcf.global.systemRequirements.active"><![CDATA[Enabled]]></item>
                <item name="wcf.global.systemRequirements.notActive"><![CDATA[Not enabled]]></item>
                <item name="wcf.global.systemRequirements.memoryLimit"><![CDATA[PHP memory limit]]></item>
index d3311f833ebfd5d7eeb24946b0376612994a9344..2a4235a56536c92eeb543c4a86c9769267efa43c 100644 (file)
                                <dl class="col-xs-12 col-md-6">
                                        <dt>{lang}wcf.global.systemRequirements.element.yours{/lang}</dt>
                                        <dd>
-                                               <span class="badge {if !$system.graphicsLibrary.result}red{else}green{/if}">{if !$system.graphicsLibrary.result}{lang}wcf.global.systemRequirements.graphicsLibrary.notFound{/lang}{else}{$system.graphicsLibrary.value}{/if}</span>
-                                               {if !$system.graphicsLibrary.result}<small>{lang}wcf.global.systemRequirements.graphicsLibrary.description{/lang}</small>{/if}
+                                               {if $system.graphicsLibrary.result}
+                                                       <span class="badge green">{$system.graphicsLibrary.value}</span>
+                                               {else}
+                                                       <span class="badge red">
+                                                               {* If the result is `false`, but the `value` is present, then the library failed the webp check. *}
+                                                               {if $system.graphicsLibrary.value}
+                                                                       {lang}wcf.global.systemRequirements.graphicsLibrary.webp{/lang}
+                                                               {else}
+                                                                       {lang}wcf.global.systemRequirements.graphicsLibrary.notFound{/lang}
+                                                               {/if}
+                                                       </span>
+                                                       <small>{lang}wcf.global.systemRequirements.graphicsLibrary.description{/lang}</small>
+                                               {/if}
                                        </dd>
                                </dl>
                        </div>