(PHP 4 >= 4.3.0, PHP 5, PHP 7, PHP 8)
gd_info — Obtém informações sobre a biblioteca GD instalada atualmente
Obtém informação sobre a versão e as capacidades da biblioteca GD instalada.
Esta função não possui parâmetros.
Retorna um array associativo.
| Atributo | Significado |
|---|---|
| GD Version | Valor string descrevendo a versão da
libgd instalada. |
| FreeType Support | Valor bool. true
se o suporte FreeType estiver instalado. |
| FreeType Linkage | Valor string dewscrevendo a maneira que
FreeType foi linkado. Os valores esperados são: 'with freetype',
'with TTF library', e 'with unknown library'. Este elemento será definido
apenas se FreeType Support for
true. |
| GIF Read Support | Valor bool. true
se o suporte para ler imagens GIF
estiver incluso. |
| GIF Create Support | Valor bool. true
se o suporte para criação de imagens GIF
estiver incluso. |
| JPEG Support | Valor bool. true
se o suporte a JPEG estiver incluso. |
| PNG Support | Valor bool. true
se o suporte a PNG estiver incluso. |
| WBMP Support | Valor bool. true
se o suporte a WBMP estiver incluso. |
| XBM Support | Valor bool. true
se o suporte a XBM estiver incluso. |
| WebP Support | Valor bool. true
se o suporte a WebP estiver incluso. |
| AVIF Support | Valor bool. true
se o suporte a AVIF estiver incluso.
Disponível a partir do PHP 8.1.0. |
Exemplo #1 Usando gd_info()
<?php
var_dump(gd_info());
?>O exemplo acima produzirá algo semelhante a:
array(10) {
["GD Version"]=>
string(24) "bundled (2.1.0 compatible)"
["FreeType Support"]=>
bool(false)
["GIF Read Support"]=>
bool(true)
["GIF Create Support"]=>
bool(false)
["JPEG Support"]=>
bool(false)
["PNG Support"]=>
bool(true)
["WBMP Support"]=>
bool(true)
["XBM Support"]=>
bool(false)
["WebP Support"]=>
bool(false)
["AVIF Support"]=>
bool(false)
}