<?php
GdImage|false imagecreatefromjpeg ( string $filename )
where,
$filename = The path to an existing JPEG 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 = "jpeg/JPEG 004 05.jpg";
$img_name = "bmp/BMP 003 01 (jpeg2bmp).bmp";
echo $img_file; ?><br><br>Existing Image
<br><br><img src="<?php echo $img_file; ?>"
alt="<?php echo $img_file; ?>" title="J P E G" width="400">
<?php
$im01 = imagecreatefromjpeg($img_file);
echo '<br><br>The resource to be used:<br><br>';
var_dump($im01);
echo '<br><br>';
$bool01 = imagebmp($im01, $img_name);
if ($bool01 == 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 '$bool01 = ' . $bool01 .
'<br><br>The image was NOT created!';
}
?>
<?php
echo 'PHP VERSION: ' . PHP_VERSION . '<br><br>';
$img_file = "jpeg/JPEG 009 02 (png2jpeg).jpg";
$img_name = "gd2/GD2 005 02 (jpeg2gd2).gd2";
echo $img_file; ?><br><br>Existing Image
<br><br><img src="<?php echo $img_file; ?>"
alt="<?php echo $img_file; ?>" title="J P E G">
<?php
$im02 = imagecreatefromjpeg($img_file);
echo '<br><br>The identifier to be used:<br><br>';
var_dump($im02);
echo '<br><br>';
$bool02 = imagegd2($im02, $img_name);
if ($bool02 == true)
{
echo 'The new format has been created!<br><br>' .
$img_name . '<br><br>';
echo 'However, it cannot be displayed by this browser.';
}
else
{
echo '$bool02 = ' . $bool02 .
'<br><br>The image was NOT created!';
}
?>
<?php
echo 'PHP VERSION: ' . PHP_VERSION . '<br><br>';
$img_file = "jpeg/JPEG 010 03.jpg";
$img_name = "wbmp/WBMP 003 03 (jpeg2wbmp).wbmp";
echo $img_file; ?><br><br>Existing Image
<br><br><img src="<?php echo $img_file; ?>"
alt="<?php echo $img_file; ?>" title="J P E G">
<?php
$im03 = imagecreatefromjpeg($img_file);
echo '<br><br>The identifier to be used:<br><br>';
var_dump($im03);
echo '<br><br>';
$bool03 = imagewbmp($im03, $img_name);
if ($bool03 == true)
{
echo 'The new format has been created!<br><br>' .
$img_name . '<br><br>';
echo 'However, it cannot be displayed by this browser.';
}
else
{
echo '$bool03 = ' . $bool03 .
'<br><br>The image was NOT created!';
}
?>