$foto_tmp = $_FILES['userfoto']['tmp_name']; $foto_nazwa = $_FILES['userfoto']['name']; $foto_rozmiar = $_FILES['userfoto']['size']; { /*++++++Wylicza wysokosc i szerokosc nowego obrazu+++++*/ if ( $width_src < $height_src ) { $nheight = 350; $nheight_s= 96; $nwidth = $width_src*$nheight/$height_src; $nwidth_s = $width_src*$nheight_s/$height_src; } elseif( $width_src > $height_src ) { $nwidth = 400; $nwidth_s = 96; $nheight = $nwidth/$width_src*$height_src; $nheight_s = $nwidth_s/$width_src*$height_src; } $dst_img=imagecreatetruecolor($nwidth,$nheight); $dst_thumb=imagecreatetruecolor($nwidth_s,$nheight_s); $src_img=ImageCreateFromJpeg($foto_tmp); $src_thumb=ImageCreateFromJpeg($foto_tmp); $new=imagecopyresampled ($dst_img, $src_img, 0, 0, 0, 0, $nwidth, $nheight, $width_src,$height_src); $imagepath='photos'; imagejpeg($dst_img, "7.jpeg", 100); $new_s=imagecopyresampled ($dst_thumb, $src_thumb, 0, 0, 0, 0, $nwidth_s, $nheight_s, $width_src,$height_src); $s_path='photos_s'; imagejpeg($dst_thumb, "8.jpeg", 100); }
Niby wszystko ok (bynajmniej jesli chodzi o pomniejszanie) jednak obraz i miniatura zapisuja sie w katalogu glownym htdocs a nie w docelowych: $imagepath i $s_path.
Co jest nie tak?