<?php
GdImage|false imagecreatefromxbm( string $filename )
where,
$filename = The path to an existing XBM 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>';
$var = getcwd();
define('STWP', 'file://' . $var . '/');
echo 'STWP = ' . STWP . '<br><br>';
$img_file = "xbm/XBM 0029 10.xbm";
$img_name = "png/PNG 023 01 (xbm-png).png";
echo $img_file; ?><br><br>Existing Image...<br>
however, it cannot be displayed by this browser.
<?php
$im01 = imagecreatefromxbm(STWP . $img_file);
// VIA STREAM WRAPPER
echo '<br><br>The resource or object to be used
to create another image format:<br><br>';
var_dump($im01);
echo '<br>';
$bool01 = imagepng($im01, $img_name);
if ($bool01 == true)
{
echo '<br><br>The new format of the image
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!';
}
?>
<?php
echo 'PHP VERSION: ' . PHP_VERSION . '<br><br>';
$img_file = "xbm/XBM 002 02.xbm";
$img_name = "gif/GIF 012 02 (xbm-gif).gif";
echo $img_file; ?><br><br>Existing Image...<br>
however, it cannot be displayed by this browser.
<?php
$im02 = imagecreatefromxbm($img_file);
echo '<br><br>The resource or object to be used
to create another image format:<br><br>';
var_dump($im02);
echo '<br>';
$bool02 = imagegif($im02, $img_name);
if ($bool02 == true)
{
echo '<br><br>The new format of the image
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 = "xbm/XBM 003 05 (gif2xbm).xbm";
$img_name = "jpeg/JPEG 015 03 (xbm-jpeg).jpg";
echo $img_file; ?><br><br>Existing Image...<br>
however, it cannot be displayed by this browser.
<?php
$im03 = imagecreatefromxbm($img_file);
echo '<br><br>The resource or object to be used
to create another image format:<br><br>';
var_dump($im03);
echo '<br>';
$bool03 = imagejpeg($im03, $img_name);
if ($bool03 == true)
{
echo '<br><br>The new format of the image
has been created!<br><br>' . $img_name . '<br><br>';
echo '<img src="' . $img_name .
'" alt="' . $img_name . '" title="' . $img_name . '">';
}
else
{
echo '$bool03 = ' . $bool03 .
'<br><br>The image was NOT created!';
}
?>
<?php
echo 'PHP VERSION: ' . PHP_VERSION . '<br><br>';
$var = getcwd();
define('STWP', 'file://' . $var . '/');
echo 'STWP = ' . STWP . '<br><br>';
$img_file = "xbm/XBM 004 04 P de Galinhas (bmp2xbm).xbm";
$img_name = "jpeg/JPEG 016 04 P de Galinhas (xbm-jpeg).jpg";
echo $img_file; ?><br><br>Existing Image...<br>
however, it cannot be displayed by this browser.
<?php
$im04 = imagecreatefromxbm(STWP . $img_file);
// VIA STREAM WRAPPER
echo '<br><br>';
echo '<br><br>The resource or object to be used
to create another image format:<br><br>';
var_dump($im04);
echo '<br>';
$bool04 = imagejpeg($im04, $img_name);
if ($bool04 == true)
{
echo '<br><br>The new format of the image
has been created!<br><br>' . $img_name . '<br><br>';
echo '<img src="' . $img_name .
'" alt="' . $img_name . '" title="' . $img_name . '" width="400">';
}
else
{
echo '$bool04 = ' . $bool04 .
'<br><br>The image was NOT created!';
}
?>