function make_thumb($file_name,$thumb_file,$width,$height)
//$file_name - putanja do slike, $thumb_file smanjena slika sa putanjom, $width - sirina slike, $height - visina slike
{
$sys=explode('.',$file_name);
$br=count($sys)-1;
if (preg_match(strtoupper('/jpg|jpeg/'),strtoupper($sys[$br])))
{
$src_img=imagecreatefromjpeg($file_name);
}
else
{
echo FILE_NOT_JPG; //Datoteka mora biti tipa jpg ili jpeg!
exit;
}
$old_x=imageSX($src_img);
$old_y=imageSY($src_img);
if ($old_x>$old_y)
{
$thumb_w=$width;
$thumb_h=$height;
}
else
{
$thumb_w=$height;
$thumb_h=$width;
}
$dest_img=ImageCreateTrueColor($thumb_w,$thumb_h);
imagecopyresampled($dest_img,$src_img,0,0,0,0,$thumb_w,$thumb_h,$old_x,$old_y);
imagejpeg($dest_img,$thumb_file);
imagedestroy($dest_img);
imagedestroy($src_img);
}
Ne znam gde gresim jer sve na localhostu radi a kod provajdera ne radi.
p.s. inace provajder je loopia ako to nesto znaci
Pomazite ljudi poludecu :)