Beispiel #1
0
// Past date
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
// Consitnuously modified
header("Cache-Control: no-cache, must-revalidate");
// HTTP/1.1
header("Pragma: no-cache");
// NO CACHE*/
/**
 * Image Related Functions
 **/
include "functions/images.php";
$text_str = $_GET['text'] ? base64_decode($_GET['text']) : 'TITLE NOT MENTIONED';
$text_size = $_GET['size'] ? $_GET['size'] : 10;
// Define the variables
$textImg_font = "eict.ttf";
$textImg_width = imageWidth($text_size, strlen($text_str));
$textImg_height = imageHeight($text_size);
// Set Co-ordinates
$bluetext_bottom = floor($textImg_height - $text_size / 2);
//Create Image of size $textImg_length x $textImg_height
$background = imagecreatetruecolor($textImg_width, $textImg_height);
// Colors Used in the image
$text_fontcolor = imagecolorallocate($background, 4, 75, 162);
$text_shadowcolor = imagecolorallocate($background, 140, 140, 140);
$text_strokecolor = imagecolorallocate($background, 255, 255, 255);
//Make it transparent
imagesavealpha($background, true);
$trans_colour = imagecolorallocatealpha($background, 0, 0, 0, 127);
imagefill($background, 0, 0, $trans_colour);
// STRIP THE SLASHES IN THE TEXT
$text_str = stripslashes($text_str);
} else {
    print "something went wrong ...\n";
    exit;
}
if (encodeImageFile($image, "test.jpg", 80, "")) {
    print "image written all fine.\n";
} else {
    print "something went wrong writing the image ...\n";
    exit;
}
# advanced use, use in memory locations
$image_bits = `cat testsuite/tif/5.1.13.tif`;
if (decodeImage($image, $image_bits)) {
    print "image read from RAM.\n";
} else {
    print "something went wrong decoding the RAM\n";
    exit;
}
# image properties
print "Width: " . imageWidth($image) . "\n";
print "Height: " . imageHeight($image) . "\n";
print "Xres: " . imageXres($image) . "\n";
print "Yres: " . imageYres($image) . "\n";
print "Channels: " . imageChannels($image) . "\n";
print "Channel depth: " . imageChannelDepth($image) . "\n";
# setable as well
imageSetXres($image, 144);
imageSetYres($image, 144);
print "Xres: " . imageXres($image) . "\n";
print "Yres: " . imageYres($image) . "\n";
deleteImage($image);