/Web/thumb.php
1,5 → 1,5
<?php
 
header("Content-type: image/jpeg");
function file_type($file){
$path_chunks = explode("/", $file);
$thefile = $path_chunks[count($path_chunks) - 1];
22,7 → 22,7
$width = "150";
$height = "150";
 
if (!file_exists("/tmp/".$filename)) {
// if (!file_exists("/tmp/".$filename)) {
 
if(in_array($extension, array('png', 'gif', 'jpg', 'jpeg'))){
if(!$img_size = getimagesize($path.$filename)){
57,8 → 57,8
$thumb = imagecreatetruecolor($thumb_width, $thumb_height);
imagecopyresampled($thumb, $image, 0, 0, 0, 0, $thumb_width, $thumb_height, $img_size[0], $img_size[1] );
$black = ImageColorAllocate($thumb, 0, 0, 0);
ImageString ($thumb, 3, $thumb_width-90, $thumb_height-15, "www.mlab.cz", $black);
imagejpeg($thumb, "/tmp/".$filename);
ImageString ($thumb, 3, $thumb_width-80, $thumb_height-15, "www.mlab.cz", $black);
imagejpeg($thumb/*, "/tmp/".$filename*/);
 
}
}else{
65,9 → 65,9
$remove_thumb = true;
}
 
}
// }
 
 
header("Content-type: image/jpeg");
readfile("/tmp/".$filename);
 
//readfile("/tmp/".$filename);
?>