skopiowałem ten kod z manuala:
<?php // The file $filename = 'test.jpg'; // Set a maximum height and width $width = 200; $height = 200; // Content type // Get new dimensions $ratio_orig = $width_orig/$height_orig; if ($width/$height > $ratio_orig) { $width = $height*$ratio_orig; } else { $height = $width/$ratio_orig; } // Resample $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, 'test1.jpg', 100); ?>
i zmienilem tylko
imagejpeg($image_p, null, 100);
na
imagejpeg($image_p, 'test1.jpg', 100);
zeby zapisywalo pomniejszony obrazek, ale caly czas dostaje blad:
"Obrazek test.jpg nie może zostać wyświetlony, ponieważ zawiera błędy."
Prosze o pomoc