<?php
GdImage|false imagecreatefrompng( string $filename )
where,
$filename = The path to an existing PNG 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 = "png/PNG 006 01.png";
echo $img_file; ?><br><br>Existing Image
<br><br><img src="<?php echo $img_file; ?>"
alt="<?php echo $img_file; ?>" title="P N G">
<?php
$im01 = imagecreatefrompng($img_file);
echo '<br><br>resource or object for the
future image to be created by this function.<br><br>';
var_dump( $im01 );
?>
<?php
echo 'PHP VERSION: ' . PHP_VERSION . '<br><br>';
$img_file = "png/PNG 019 02 (gif2png).png";
$img_name = "jpeg/JPEG 009 02 (png2jpeg).jpg";
echo $img_file; ?><br><br>Existing Image
<br><br><img src="<?php echo $img_file; ?>"
alt="<?php echo $img_file; ?>" title="P N G">
<?php
$im02 = imagecreatefrompng($img_file);
echo '<br><br>The identifier to be used:<br><br>';
var_dump($im02);
$bool02 = imagejpeg($im02, $img_name);
if ($bool02 == true)
{
echo '<br><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 '$bool02 = ' . $bool02 .
'<br><br>The image was NOT created!';
}
?>
<?php
echo 'PHP VERSION: ' . PHP_VERSION . '<br><br>';
$img_file = "png/PNG 006 01.png";
$img_name = "gd/GD 004 03 (png2gd).gd";
echo $img_file; ?><br><br>Existing Image
<br><br><img src="<?php echo $img_file; ?>"
alt="<?php echo $img_file; ?>" title="P N G">
<?php
$im03 = imagecreatefrompng($img_file);
echo '<br><br>The identifier to be used:<br><br>';
var_dump($im03);
$bool03 = imagegd($im03, $img_name);
if ($bool03 == true)
{
echo '<br><br>The new format has been created!<br><br>';
echo $img_name;
echo '<br><br>However, it cannot be
displayed by this browser.';
}
else
{
echo '$bool03 = ' . $bool03 .
'<br><br>The image was NOT created!';
}
?>