gd_info

(PHP 4 >= 4.3.0, PHP 5, PHP 7, PHP 8)

gd_infoDevuelve información sobre la biblioteca GD instalada

Descripción

gd_info(): array

Devuelve información sobre la biblioteca GD instalada.

Parámetros

Esta función no tiene parámetros.

Valores devueltos

Devuelve un array asociativo.

Elementos del array devueltos por gd_info()
Atributo Significado
GD Version chaîne de caractères que describe la versión de libgd que está instalada.
FreeType Support booléen. true si el soporte FreeType está instalado.
FreeType Linkage chaîne de caractères que describe la forma en la que FreeType ha sido vinculado. Los valores esperados son: 'with freetype', 'with TTF library' y 'with unknown library'. Este elemento solo estará definido si FreeType Support es evaluado true.
GIF Read Support booléen. true si el soporte para la lectura de imágenes GIF está incluido.
GIF Create Support booléen. true si el soporte para la creación de imágenes GIF está incluido.
JPEG Support booléen. true si el soporte de JPEG está incluido.
PNG Support booléen. true si el soporte de PNG está incluido.
WBMP Support booléen. true si el soporte de WBMP está incluido.
XBM Support booléen. true si el soporte de XBM está incluido.
WebP Support Valor de tipo bool. true si el soporte WebP está incluido.
AVIF Support Valor de tipo bool. true si el soporte AVIF está incluido. Disponible a partir de PHP 8.1.0.

Ejemplos

Ejemplo #1 Ejemplo con gd_info()

<?php
var_dump
(gd_info());
?>

El resultado del ejemplo sería algo similar a:

array(9) {
  ["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)
}

Ver también

  • imagepng() - Envía una imagen PNG a un navegador o a un fichero
  • imagejpeg() - Exportar la imagen al navegador o a un fichero
  • imagegif() - Exportar la imagen al navegador o a un fichero
  • imagewbmp() - Exportar la imagen al navegador o a un fichero
  • imagewebp() - Muestra una imagen WebP hacia un navegador o un fichero
  • imageavif() - Exportar la imagen al navegador o a un fichero
  • imagetypes() - Devuelve los tipos de imágenes soportados por la versión actual de PHP