/Web/thumb.php
1,5 → 1,4
<?php
header("Content-type: image/jpeg");
function file_type($file){
$path_chunks = explode("/", $file);
$thefile = $path_chunks[count($path_chunks) - 1];
22,7 → 21,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)){
58,7 → 57,7
imagecopyresampled($thumb, $image, 0, 0, 0, 0, $thumb_width, $thumb_height, $img_size[0], $img_size[1] );
$black = ImageColorAllocate($thumb, 0, 0, 0);
if ($filename <> "nopicture2.jpg") {ImageString ($thumb, 3, $thumb_width-80, $thumb_height-15, "www.mlab.cz", $black);}
imagejpeg($thumb/*, "/tmp/".$filename*/);
imagejpeg($thumb, "/tmp/".$filename);
 
}
}else{
65,9 → 64,9
$remove_thumb = true;
}
 
// }
}
 
 
 
//readfile("/tmp/".$filename);
header("Content-type: image/jpeg");
readfile("/tmp/".$filename);
?>