PHP 8.3.4 Released!

gd_info

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

gd_infoReunir información acerca de la biblioteca GD instalada actualmente

Descripción

gd_info(): array

Obtiene información acerca de la versión y capacidades de la biblioteca GD instalada.

Valores devueltos

Devuelve un array asociativo.

Elementos del array devuelto por gd_info()
Atributo Significado
GD Version valor de tipo string que describe la versión de libgd instalada.
FreeType Support valor de tipo boolean. true si está instalado el soporte para Freetype.
Freetype Linkage valor de tipo string que describe la forma en la cual Freetype fue vinculado. Los valores esperados son: 'with freetype', 'with TTF library' y 'with unknown library'. Este elemento sólo estará definido si Freetype Support fue evaluado como true.
T1Lib Support valor de tipo boolean. true si el soporte para T1Lib está incluido.
GIF Read Support valor de tipo boolean. true si el soporte para la lectura de imágenes GIF está incluido.
GIF Create Support valor de tipo boolean. true si el soporte para la creación de imágenes GIF está incluido.
JPEG Support valor de tipo boolean. true si el soporte para JPEG está incluido.
PNG Support valor de tipo boolean. true si el soporte para PNG está incluido.
WBMP Support valor de tipo boolean. true si el soporte para WBMP está incluido.
XBM Support valor de tipo boolean. true si el soporte para XBM está incluido.
WebP Support Valor de tipo boolean. true si el soporte para WebP está incluido.

Nota:

Antes de PHP 5.3.0, el atributo JPEG Support se llamaba JPG Support.

Ejemplos

Ejemplo #1 Empleo de gd_info()

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

El resultado del ejemplo sería algo similar a:

array(10) {
  ["GD Version"]=>
  string(24) "bundled (2.1.0 compatible)"
  ["FreeType Support"]=>
  bool(false)
  ["T1Lib 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)
}

Historial de cambios

Versión Descripción
5.6.12 Se añadió WebP Support.
5.3.0 El atributo JPG Support se renombró a JPEG Support.

Ver también

  • imagepng() - Imprimir una imagen PNG al navegador o a un archivo
  • 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() - Imprimir una imagen WebP al navegador o fichero
  • imagetypes() - Devolver los tipos de imagen soportados por la versión actual de PHP

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top