(PHP 4 >= 4.0.7, PHP 5)
imagecreatefromgd — Create a new image from GD file or URL
Create a new image from GD file or URL.
Даден URL може да бъде използван като име на файл с тази функция ако fopen wrappers е включено. Виж fopen() за повече подробности относно начина, по който се задава име на файл и List of Supported Protocols/Wrappers за списък с поддържаните URL протоколи.
Path to the GD file.
Returns an image resource identifier on success, FALSE on errors.
Example #1 imagecreatefromgd() example
<?php
// Load the gd image
$im = @imagecreatefromgd('./test.gd');
// Test if the image was loaded
if(!is_resource($im))
{
die('Unable to load gd image!');
}
// Do image operations here
// Save the image
imagegd($im, './test_updated.gd');
imagedestroy($im);
?>
Windows версиите на PHP преди PHP 4.3.0 не поддържат достъпа до отдалечени файлове посредством тази функция, дори и ако allow_url_fopen е включено.