Skip to content

Commit

Permalink
2.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
AndiLeni committed Jul 28, 2023
1 parent eb88fc0 commit e88b469
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 1 deletion.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog


## [2.2.1] - 28.07.2023

- Settings page shows which functions are available and which output formats are possible



## [2.2.0] - 28.07.2023

- Added setting to force usage of Imagick. F.e. when GD is not supporting avif as expected.
Expand Down
2 changes: 1 addition & 1 deletion package.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package: media_negotiator
version: 2.2.0
version: 2.2.1
name: Media Negotiator
author: Andreas Lenhardt
supportpage: https://github.com/AndiLeni/media_negotiator
Expand Down
35 changes: 35 additions & 0 deletions pages/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

<?php

use media_negotiator\Helper;

$form = rex_config_form::factory("media_negotiator");


Expand All @@ -16,3 +18,36 @@
$fragment->setVar('title', "Einstellungen", false);
$fragment->setVar('body', $form->get(), false);
echo $fragment->parse('core/page/section.php');

?>

<h3>Verfügbare Funktionen:</h3>

<?php

if (class_exists(Imagick::class)) {
echo '<p class="text-success bold"><b>Imagick ist installiert</b></p>';
} else {
echo '<p class="text-danger bold"><b>Imagick ist nicht installiert</b></p>';
}

if (function_exists('imageavif')) {
echo '<p class="text-success bold"><b>imageavif ist verfügbar</b></p>';
} else {
echo '<p class="text-danger bold"><b>imageavif ist nicht verfügbar</b></p>';
}

if (function_exists('imagewebp')) {
echo '<p class="text-success bold"><b>imagewebp ist verfügbar</b></p>';
} else {
echo '<p class="text-danger bold"><b>imagewebp ist nicht verfügbar</b></p>';
}

$canGenerateWebp = Helper::getOutputFormat(['image/webp']) == "webp" ? '<span class="text-success"><b>ja</b></span>' : '<span class="text-danger"><b>nein</b></span>';
$canGenerateAvif = Helper::getOutputFormat(['image/avif']) == "avif" ? '<span class="text-success"><b>ja</b></span>' : '<span class="text-danger"><b>nein</b></span>';

echo "<p>WEBP Ausgabe möglich: {$canGenerateWebp}</p>";
echo "<p>AVIF Ausgabe möglich: {$canGenerateAvif}</p>";


?>

0 comments on commit e88b469

Please sign in to comment.