Mam mały problem z resizem oraz uploadem pliczku Jpg na stronie... Otóż mój skrypt nadrzędny wygląda tak:
<?php $file = 'file'.$licz; $li = $row['id'] + 1; $name = ''.$li.'_'.$row1['id'].''; $width = 500; $height = 500; $images_res = $_FILES[$file]['name']; $path_res = '../images/users/'; require('../includes/img_res.php'); ?>
a plik img_res.php wygląda tak:
<?php $filename = $images_res; { { exit; } } else { exit; } $ratio_orig = $width_orig/$height_orig; if ($width/$height > $ratio_orig) { $width = $height*$ratio_orig; } else { $height = $width/$ratio_orig; } $image_p = imagecreatetruecolor($width, $height); $image = imagecreatefromjpeg($filename); imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig); // Output imagejpeg($image_p, $path_res . $name, 75); ?>
I za nic nie chce mi przetworzyć pliku...
Proszę o pomoc lub ewentualne wskazanie innego rozwiązania.
Pozdrawiam!