- about you -
Unknown Browser on Unknown OS
CCBot/1.0 (+http://www.commoncrawl.org/bot.html)
38.103.63.60
Unknown Browser on Unknown OS
CCBot/1.0 (+http://www.commoncrawl.org/bot.html)
38.103.63.60
- blog -
- quotation of the moment -
I know war as few other men now living know it, and nothing to me is more revolting. I have long advocated its complete abolitionment, as its very destructiveness on both friend and foe has rendered it useless as a method of settling international disputes.
Douglas MacArthur
I know war as few other men now living know it, and nothing to me is more revolting. I have long advocated its complete abolitionment, as its very destructiveness on both friend and foe has rendered it useless as a method of settling international disputes.
Douglas MacArthur
<?
header("Content-type: image/jpeg");
header("Content-Disposition: inline;
filename=" . $_GET['image'] . '.jpg');
$cacheDir='put/image/cache/here';
$image = 'put/image/dir/here' . $_GET['image'] . '.jpg';
$newwidth = $_GET['width'];
$newheight = $_GET['height'];
if (!$_GET['image']) {
$im=imageCreate(200,20);
$bg=imageColorAllocate($im, 0, 0, 0);
imageFilledRectangle($im, 0, 0, 200, 20, $bg);
$fg=imageColorAllocate($im, 255, 255, 255);
imagestring($im, 1, 5, 5,"No image file was specified", $fg);
imagejpeg($im);
imagedestroy($im);
exit;
} if (!file_exists($image)) {
$im=imageCreate(200,20);
$bg=imageColorAllocate($im, 0, 0, 0);
imageFilledRectangle($im, 0, 0, 200, 20, $bg);
$fg=imageColorAllocate($im, 255, 255, 255);
imageString($im, 1, 5, 5, $_GET['image'] . " does not exist", $fg);
imagejpeg($im);
imagedestroy($im);
exit;
} list($width, $height)=getimagesize($image);
if ($newheight=='' || $newwidth=='') {
$newheight=$height;
$newwidth=$width;
}/* else if ($newheight=='' && $newwidth!='') {
$newheight=($height)*($newwidth/$width);
$newwidth=$width;
} else if ($newheight!='' && $newwidth='') {
$newheight=$height;
$newwidth=($width)*($newheight/$height);
}*/ $rotate=$_GET['rotate'];
$cacheName=$cacheDir . md5($image . '-r:' . ($rotate%4) . '-d:' . $newheight . 'x' . $newwidth) . '.jpg';
if (file_exists($cacheName)) {
readfile($cacheName);
} else {
$src=imageCreateFromJPEG($image);
$im=imageCreateTrueColor($newwidth,$newheight);
imagecopyresampled($im,$src,0,0,0,0,$newwidth,$newheight,$width,$height);
if ($rotate!='') {
$im=imageRotate($im, ($rotate%4)*360/4, 0);
} if ($newwidth>100) {
$brand=imageCreateFromPNG('images/brand.png');
imageColorTransparent($brand, imagecolorallocate($brand, 255, 255, 255));
imageCopyMerge($im, $brand, imagesx($im)/2-imagesx($brand)/2, imagesy($im)-imagesy($brand), 0, 0, imagesx($brand), imagesy($brand), 100);
} imagejpeg($im, $cacheName);
imagejpeg($im);
imagedestroy($src);
imagedestroy($im);
} ?>
header("Content-type: image/jpeg");
header("Content-Disposition: inline;
filename=" . $_GET['image'] . '.jpg');
$cacheDir='put/image/cache/here';
$image = 'put/image/dir/here' . $_GET['image'] . '.jpg';
$newwidth = $_GET['width'];
$newheight = $_GET['height'];
if (!$_GET['image']) {
$im=imageCreate(200,20);
$bg=imageColorAllocate($im, 0, 0, 0);
imageFilledRectangle($im, 0, 0, 200, 20, $bg);
$fg=imageColorAllocate($im, 255, 255, 255);
imagestring($im, 1, 5, 5,"No image file was specified", $fg);
imagejpeg($im);
imagedestroy($im);
exit;
} if (!file_exists($image)) {
$im=imageCreate(200,20);
$bg=imageColorAllocate($im, 0, 0, 0);
imageFilledRectangle($im, 0, 0, 200, 20, $bg);
$fg=imageColorAllocate($im, 255, 255, 255);
imageString($im, 1, 5, 5, $_GET['image'] . " does not exist", $fg);
imagejpeg($im);
imagedestroy($im);
exit;
} list($width, $height)=getimagesize($image);
if ($newheight=='' || $newwidth=='') {
$newheight=$height;
$newwidth=$width;
}/* else if ($newheight=='' && $newwidth!='') {
$newheight=($height)*($newwidth/$width);
$newwidth=$width;
} else if ($newheight!='' && $newwidth='') {
$newheight=$height;
$newwidth=($width)*($newheight/$height);
}*/ $rotate=$_GET['rotate'];
$cacheName=$cacheDir . md5($image . '-r:' . ($rotate%4) . '-d:' . $newheight . 'x' . $newwidth) . '.jpg';
if (file_exists($cacheName)) {
readfile($cacheName);
} else {
$src=imageCreateFromJPEG($image);
$im=imageCreateTrueColor($newwidth,$newheight);
imagecopyresampled($im,$src,0,0,0,0,$newwidth,$newheight,$width,$height);
if ($rotate!='') {
$im=imageRotate($im, ($rotate%4)*360/4, 0);
} if ($newwidth>100) {
$brand=imageCreateFromPNG('images/brand.png');
imageColorTransparent($brand, imagecolorallocate($brand, 255, 255, 255));
imageCopyMerge($im, $brand, imagesx($im)/2-imagesx($brand)/2, imagesy($im)-imagesy($brand), 0, 0, imagesx($brand), imagesy($brand), 100);
} imagejpeg($im, $cacheName);
imagejpeg($im);
imagedestroy($src);
imagedestroy($im);
} ?>

