Код:
function mkthumb($src, $Twidth) {
$name = basename(strtolower($src));
$F = end(explode(".", $name));
if($F == "jpg" OR $F == "jpeg") {
$img = imagecreatefromjpeg($src);
}
else if($F == "png") {
$img = imagecreatefrompng($src);
} else {
$img = imagecreatefromgif($src);
}
list($width, $height) = getimagesize($src);
$thumbwidth = $Twidth;
$thumbheight = round($height*($thumbwidth/$width));
$thumb = imagecreatetruecolor($thumbwidth, $thumbheight);
imagecopyresized($thumb, $img, 0, 0, 0, 0, $thumbwidth, $thumbheight, $width, $height);
imagejpeg($thumb, "thumbs/".$name, 100);
}
Strict Standards: Only variables should be passed by reference in
на реда $F= end explore . $name))