Io l'ho fatto così:
codice:// // RIDIMENSIONA IMMAGINE // function resizeJPG($jpgFile, $width, $jpgNewFile) { // Get new dimensions list($width_orig, $height_orig) = getimagesize($jpgFile); $height = (int) (($width / $width_orig) * $height_orig); // Resample $image_p = imagecreatetruecolor($width, $height); $image = imagecreatefromjpeg($jpgFile); imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig); // Output imagejpeg($image_p, $jpgNewFile, 60); }