Codice PHP:
$width_percent = 0.5; // 50% dell'originale
// Caricamento immagine
$im = @imagecreatefromjpeg($image_file);
// Leggo le dimensioni originali dell'immagine
$width = imagesx($im);
$height = imagesy($im);
// Imposto le nuove dimensioni dell'immagine
$new_width = $width * $width_percent;
$new_height = ($new_width * $height) / $width;
// Ridimensiono l'immagine
$im_resized = imagecreatetruecolor($new_width, $new_height);
imagecopyresampled($im_resized, $im, 0, 0, 0, 0, $new_width, $new_height, $width, $height);
in maniera molto banale...così...