<?php
GdImage|false imagecreatefrombmp( string $filename )
where,
$filename = The path to an existing BMP 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 = "bmp/BMP 004 01 Katedrála Sv. Víta.bmp";
$img_name = "jpeg/JPEG 011 01 Katedrála Sv. Víta (bmp2jpeg).jpg";
echo $img_file; ?><br><br>Existing Image
<br><br><img src="<?php echo $img_file; ?>"
alt="<?php echo $img_file; ?>" title="B M P" width="400">
<?php
$imi01 = imagecreatefrombmp($img_file);
echo '<br><br>The identifier to be used:<br><br>';
var_dump($imi01);
echo '<br><br>';
$bool01 = imagejpeg($imi01, $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 . '" width="400">';
}
else
{
echo '$bool01 = ' . $bool01 .
'<br><br>The image was NOT created!';
}
?>
<?php
echo 'PHP VERSION: ' . PHP_VERSION . '<br><br>';
$img_file = "bmp/BMP 005 02 P de Galinhas.bmp";
$img_name = "webp/WEBP 005 02 P de Galinhas (bmp2webp).webp";
echo $img_file; ?><br><br>( Existing Image )
<br><br><img src="<?php echo $img_file; ?>"
alt="<?php echo $img_file; ?>" title="B M P" width="400">
<?php
$imi02 = imagecreatefrombmp($img_file);
echo '<br><br>The resource to be used:<br><br>';
var_dump($imi02);
echo '<br><br>';
$bool02 = imagewebp($imi02, $img_name);
if ($bool02 == true)
{
echo 'The new format has been created!<br><br>' .
$img_name . '<br><br>';
echo '<img src="' . $img_name .
'" alt="' . $img_name . '" title="' . $img_name . '" width="400">';
}
else
{
echo '$bool02 = ' . $bool02 .
'<br><br>The image was NOT created!';
}
?>
<?php
echo 'PHP VERSION: ' . PHP_VERSION . '<br><br>';
$img_file = "bmp/BMP 005 02 P de Galinhas.bmp";
$img_name = "wbmp/WBMP 004 03 P de Galinhas (bmp2wbmp).wbmp";
echo $img_file; ?><br><br>Existing Image
<br><br><img src="<?php echo $img_file; ?>"
alt="<?php echo $img_file; ?>" title="B M P" width="400">
<?php
$imi03 = imagecreatefrombmp($img_file);
echo '<br><br>The resource to be used:<br><br>';
var_dump($imi03);
echo '<br><br>';
$bool03 = imagewbmp($imi03, $img_name);
if ($bool03 == true)
{
echo 'The new format has been created!<br><br>' .
$img_name . '<br><br>';
echo 'Not displayed by this browser';
}
else
{
echo '$bool03 = ' . $bool03 .
'<br><br>The image was NOT created!';
}
?>
<?php
echo 'PHP VERSION: ' . PHP_VERSION . '<br><br>';
$img_file = "bmp/BMP 007 03 P de Galinhas (wbmp2bmp).bmp";
$img_name = "xbm/XBM 004 04 P de Galinhas (bmp2xbm).xbm";
echo $img_file; ?><br><br>Existing Image
<br><br><img src="<?php echo $img_file; ?>"
alt="<?php echo $img_file; ?>" title="B M P" width="400">
<?php
$imi04 = imagecreatefrombmp($img_file);
echo '<br><br>The resource to be used:<br><br>';
var_dump($imi04);
echo '<br><br>';
$bool04 = imagexbm($imi04, $img_name);
if ($bool04 == true)
{
echo 'The new format has been created!<br><br>' .
$img_name . '<br><br>';
echo 'Not displayed by this browser';
}
else
{
echo '$bool04 = ' . $bool04 .
'<br><br>The image was NOT created!';
}
?>