docker-php-extension-installer/scripts/tests/imagick
2021-09-28 12:27:17 +02:00

22 lines
597 B
PHP
Executable File

#!/usr/bin/env php
<?php
require_once __DIR__ . '/_bootstrap.php';
$requiredFormats = array_map('strtoupper', [
'BMP',
'GIF',
'JPG',
'PNG',
'SVG',
'TIFF',
]);
$supportedFormats = array_map('strtoupper', Imagick::queryFormats());
$missingFormats = array_diff($requiredFormats, $supportedFormats);
if ($missingFormats !== []) {
sort($missingFormats);
fwrite(STDERR, "Imagick does NOT support these formats:\n- " . implode("\n- ", $missingFormats) . "\n");
exit(1);
}
echo "Imagick supports at least these formats:\n- ", implode("\n- ", $requiredFormats), "\n";