dico prima che su PHP ne so meno di 0.
Ho trovato questo script per il resize che funziona benissimo.
<?php
$maxx = 300;
$maxy = 255;
$source_image_URL = 'public/Foto/foto.jpg';
$source_image = imagecreatefromjpeg($source_image_URL);
list($width, $height) = getimagesize($source_image_URL);
$percent1 = $width / $maxx;
$percent2 = $height / $maxy;
$percent = max($percent1,$percent2);
$new_eight = round($height /$percent);
$new_width = round($width /$percent);
$dest_image = imagecreatetruecolor($new_width, $new_eight);
imagecopyresampled ($dest_image, $source_image, 0, 0, 0, 0, $new_width, $new_eight, $width, $height);
header("Content-type: image/jpeg");
ob_start();
imagejpeg($dest_image);
$size=ob_get_length();
header("Content-Length: $size");
ob_end_flush();
imagedestroy($dest_image);
imagedestroy($source_image);
?>
Ora ho bisogno di salvare questa immagine con un altro nome sempre nello stesso percorso.
Grazie![]()