(PHP 4 >= 4.0.7, PHP 5, PHP 7, PHP 8)
imagecreatefromgd — Create a new image from GD file or URL
Create a new image from GD file or URL.
È 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.
filename
Path to the GD file.
Versione | Descrizione |
---|---|
8.0.0 | On success, this function returns a GDImage instance now; previously, a resource was returned. |
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');
?>
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.