At the time of this writing, imagegammacorrect was not part of PHP 4, although it was
part of PHP 3.
<?
//attempt to open image, suppress error messages
if(!($image = @imagecreatefromjpeg("php_lang.jpg")))
{
//error, so create an error image and exit
$image = imagecreate(200,200);
$colorWhite = imagecolorallocate($image, 255, 255, 255);
$colorBlack = imagecolorallocate($image, 0, 0, 0);
imagefill($image, 0, 0, $colorWhite);
imagestring($image, 4, 10, 10, "Couldn't load image!",
$colorBlack);
header("Content-type: image/jpeg");
imagejpeg($image);
exit();
}
//adjust gamma, display
imagegammacorrect($image, 2.2, 1.571);
//send image
header("Content-type: image/jpeg");
imagejpeg($image);
?>
boolean imageinterlace(integer image, boolean on)
Use imageinterlace to set an image as interlaced or not. If the change is successful,
TRUE is returned.
Interlaced images are stored so that they appear progressively rather than all at once.
JPEGs marked as interlaced are called progressive JPEGs, in fact. While most browsers
support interlaced product of the number of characters, the width, and the height. GIFs,
many do not support interlaced PNGs or progressive JPEGs. You can read more on the
subject in the GD library's manual.
?
/*
* Create interlaced image
/
//create red square
$image = imagecreate(200,200);
$colorRed = imagecolorallocate($image, 255, 0, 0);
imagefill($image, 0, 0, $colorRed);
//set as interlaced
imageinterlace($image, TRUE);