phpday 2027 - Call for Papers

imagecreatefromgd

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

imagecreatefromgd — Create a new image from GD file or URL

Descrizione

function imagecreatefromgd(string $filename): GdImage|false

Create a new image from GD file or URL.

Suggerimento

È possibile utilizzare un URL come nome di file con questa funzione se i fopen wrapper sono stati abilitati. Vedere fopen() per maggiori dettagli su come specificare il nome del file. Vedere Protocolli e Wrapper supportati per i link alle informazioni sulle capacità dei vari wrapper, note sul loro uso e informazioni sulle eventuali variabili predefinite che forniscono.

Elenco dei parametri

filename

Path to the GD file.

Valori restituiti

Restituisce un oggetto immagine in caso di successo, 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');
?>

Note

Avviso

I formati di immagine GD e GD2 sono formati di immagine proprietari di libgd. Devono essere considerati obsoleti, e dovrebbero essere usati solo a scopo di sviluppo e test.

+add a note

User Contributed Notes

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