Secondo voi come mai questo codice funziona solo con immagini piccole e non funge con quelle superiori a 300 Kb?
Codice PHP:
$filename = $newfile;
header('Content-type: image/jpeg');
list($width, $height) = getimagesize($filename);
$newwidth = 800;
$newheight = 600;
// Load
$thumb = imagecreatetruecolor($newwidth, $newheight);
$source = imagecreatefromjpeg($filename);
// Resize
imagecopyresampled($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);
// Output
imagejpeg($thumb,"prova.jpg");