<?php
GdImage|false imagecreatefromgd2( string $filename )
where,
$filename = The path to an existing GD2 image
?>
STREAM WRAPPERS | MEANING |
file:// | LOCAL File System |
http:// | URL HTTP |
ftp:// | URL FTP |
php:// | I/O streams |
zlib:// | Data Compression stream |
data:// | DATA (RFC-2397) |
glob:// | Find Filenames |
phar:// | PHP Archive |
ssh2:// | Secure Shell 2 |
rar:// | RAR |
ogg:// | Audio |
expect:// | Interaction of stream processes |
ed48 |
<?php
echo 'PHP VERSION: ' . PHP_VERSION . '<br><br>';
$img_file = "gd2/GD2 005 02 (jpeg2gd2).gd2";
echo $img_file; ?><br><br>Existing Image...<br><br>
However, it cannot be displayed by this browser.
<?php
$im01 = imagecreatefromgd2($img_file);
echo '<br><br>The resource to be used:<br><br>';
var_dump($im01);
echo '<br><br>';
$img_name = "png/PNG 020 01 (gd22png).png";
$bool01 = imagepng($im01, $img_name);
if ($bool01 == true)
{
echo '<br><br>The new format has been created!<br><br>' .
$img_name . '<br><br>';
echo '<img src="' . $img_name .
'" alt="' . $img_name . '" title="' . $img_name . '">';
}
else
{
echo '$bool01 = ' . $bool01 .
'<br><br>The image was NOT created!';
}
?>