Visualizzazione dei risultati da 1 a 3 su 3
  1. #1

    Piccolissimo aiuto per GD (salvataggio)

    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
    Io nella vita ho visto cose che voi astemi neanche potete immaginare.

  2. #2

  3. #3
    benissimo, grazie.
    Ho aggiunto: imagejpeg($dest_image, 'public/Foto/test.jpg', 100);
    ed in questo modo la vedo e la salvo .
    TY
    Io nella vita ho visto cose che voi astemi neanche potete immaginare.

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.