dzien dobry
mam maly problem znalazlem w necie taki oto generator miniaturek
<?
$galeria="mini";
$nazwa= "test-php3.jpg";
$out =$galeria . "/" . $nazwa;
//$out= $nazwa;
echo "$out<BR>";
$file = "test.jpg";//$uploadfile;
$max_width = 300;
$max_height = 100;
$size = GetImageSize($file);
$width = $size[0];
$height = $size[1];
$x_ratio = $max_width / $width;
$y_ratio = $max_height / $height;
if (($width <= $max_width) && ($height <= $max_height)) {
$tn_width = $width;
$tn_height = $height;
} else
if (($x_ratio * $height) < $max_height) {
$tn_height = ceil($x_ratio * $height);
$tn_width = $max_width;
} else {
$tn_width = ceil($y_ratio * $width);
$tn_height = $max_height;
}
$src = ImageCreateFromJpeg($file);
$dst = ImageCreateTrueColor($tn_width,$tn_height);
ImageCopyResampled($dst, $src, 0, 0, 0, 0, $tn_width,$tn_height,$width,$height);
if(ImageJpeg($dst, $out, 85))
{
echo " ok zapisane<BR>";
}else{echo " dalej cos nie dziala ;P<BR>";}
ImageDestroy($src);
ImageDestroy($dst);
?>
i bardzo fajnie dziala tylko ze... gdy chce uzyc imagejpeg gdzie drugim parametrem jest tylko nazwa obrazka np test-php.jpg to dziala fajnie obrazek sie robi zapisuje cacy ;p ale gdy chce jako drugiego parametru uzyc nazwy folderu i obrazka to zaczyna sie maly problem ... probowlaem np tak "mini/test-php.jpg" i nic
bede bardzo wdzieczny za pomoc