Merge pull request #199 from mlocati/imagick-svg

Let imagick understand SVG
pull/201/head 1.1.2
Michele Locati 2020-12-03 18:46:42 +01:00 committed by GitHub
commit 2c7ef743b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 35 additions and 1 deletions

View File

@ -402,7 +402,7 @@ buildRequiredPackageLists() {
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile imagemagick-dev" buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile imagemagick-dev"
;; ;;
imagick@debian) imagick@debian)
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libmagickwand-6.q16-[0-9]+$" buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libmagickwand-6.q16-[0-9]+ libmagickcore-6.q16-[0-9]+-extra$"
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libmagickwand-dev" buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libmagickwand-dev"
;; ;;
imap@alpine) imap@alpine)

34
scripts/tests/imagick Executable file
View File

@ -0,0 +1,34 @@
#!/usr/bin/env php
<?php
set_error_handler(
static function ($errno, $errstr, $errfile, $errline) {
$msg = "Error {$errno}: {$errstr}\n";
if ($errfile) {
$msg .= "File: {$errfile}\n";
if ($errline) {
$msg .= "Line: {$errline}\n";
}
}
fwrite(STDERR, $msg);
exit(1);
},
-1
);
$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";