imagecreatefromgd
PHP function
Edit on GitHub ✎
(PHP 4 >= 4.0.7, PHP 5, PHP 7, PHP 8)
Create a new image from GD file or URL
Description
imagecreatefromgd(string $filename): GdImage|false
Create a new image from GD file or URL.
Fopen-wrapper
Parameters
filenamePath to the GD file.
Return Values
Identifier
Changelog
| Version | Description |
|---|---|
| 8.0.0 | On success, this function returns a GDImage instance now; previously, a resource was returned. |
Examples
imagecreatefromgd() example
php
<?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');
?>