stworzyłem plik o jakim mowiles w poprzednim temacie
<?php
require_once(\"../inc/conf.php\");
$width = $size[0];
$height = $size[1];
$types = array(\"1\" => \"GIF\", \"2\" => \"JPG\",
\"3\" => \"PNG\");
$type = $size[2];
$type = $types[$type];
//tutaj okreslam czy fotka jest pionowa czy pozioma i podaje dokladne wymiary
if($width > $height)
{
$width = $foto_x[0];
$height = $foto_x[1];
}
else
{
$width = $foto_y[0];
$height = $foto_y[1];
}
if($type == \"JPG\")
{
$img = imagecreatefromjpeg($img);
$thumb = imagecreatetruecolor($width, $height);
imagecopyresized($thumb, $img, 0, 0, 0, 0, $width, $height, $size[0], $size[1]);
header(\"Content-type: image/jpeg\"); imagejpeg($thumb);
}
elseif($type == \"PNG\")
{
$img = imagecreatefrompng($img);
$thumb = imagecreatetruecolor($width, $height);
imagecopyresized($thumb, $img, 0, 0, 0, 0, $width, $height, $size[0], $size[1]);
header(\"Content-type: image/png\"); imagepng($thumb);
}
elseif($type == \"GIF\")
{
$img = imagecreatefromgif($img);
$thumb = imagecreatetruecolor($width, $height);
imagecopyresized($thumb, $img, 0, 0, 0, 0, $width, $height, $size[0], $size[1]);
header(\"Content-type: image/gif\"); imagegif($thumb);
}
@imagedestroy($img);
@imagedestroy($thumb);
?>
no in niestety plik nie zapisuje sie na dysku