PHP 8.3.4 Released!

Imagick::queryFormats

(PECL imagick 2, PECL imagick 3)

Imagick::queryFormatsRetourne les formats supportés par Imagick

Description

public static Imagick::queryFormats(string $pattern = "*"): array

Retourne les formats supportés par Imagick.

Liste de paramètres

pattern

Valeurs de retour

Retourne un tableau contenant les formats supportés par Imagick.

Erreurs / Exceptions

Lance une exception ImagickException si une erreur survient.

Exemples

Exemple #1 Exemple avec Imagick::queryFormats()

<?php
function render() {
$output = "";
$input = \Imagick::queryformats();
$columns = 6;

$output .= "<table border='2'>";

for (
$i=0; $i < count($input); $i += $columns) {
$output .= "<tr>";
for (
$c=0; $c<$columns; $c++) {
$output .= "<td>";
if ((
$i + $c) < count($input)) {
$output .= $input[$i + $c];
}
$output .= "</td>";
}
$output .= "</tr>";
}

$output .= "</table>";

return
$output;
}

?>

add a note

User Contributed Notes 1 note

up
0
kawewong at gmail dot com
2 years ago
The pattern argument is case sensitive. Example:

<?php
$input
= \Imagick::queryformats('PNG*');
?>

The PNG* will be included PNG, PNG00, PNG24, PNG32, PNG48, PNG64, PNG8

(Reference https://www.geeksforgeeks.org/php-imagick-queryformats-function/ )

If you enter png* then it will be return nothing.
To Top