PHP 8.3.4 Released!

imagecreatefromgd

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

imagecreatefromgdCreate a new image from GD file or URL

Descrizione

imagecreatefromgd(string $filename): GdImage|false

Create a new image from GD file or URL.

Suggerimento

È possibile utilizzare una URL come un nome di file con questa funzione se fopen wrappers è stata abilitata. Vedere fopen() per maggiori informazioni su come specificare i nomi di file. Vedere Supported Protocols and Wrappers per i link verso le informazioni sulle capacità dei vari wrapper, note sul loro uso, informazioni sulle variabili predefinite che forniscono.

Elenco dei parametri

filename

Path to the GD file.

Valori restituiti

Restituisce un identificatore di risorsa immagine, false in caso di errore.

Log delle modifiche

Versione Descrizione
8.0.0 On success, this function returns a GDImage instance now; previously, a resource was returned.

Esempi

Example #1 imagecreatefromgd() example

<?php
// Load the gd image
$im = @imagecreatefromgd('./test.gd');

// Test if the image was loaded
if(!$im)
{
die(
'Unable to load gd image!');
}

// Do image operations here

// Save the image
imagegd($im, './test_updated.gd');
imagedestroy($im);
?>

Note

Avviso

The GD and GD2 image formats are proprietary image formats of libgd. They have to be regarded obsolete, and should only be used for development and testing purposes.

add a note

User Contributed Notes

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