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

    image copy e caratteri strani

    eseguo questa funzione:

    $maxx = 126;
    $maxy = 126;
    $source_image_URL = "../fotoutenti/$nickk/foto1.jpeg";
    $source_image = imagecreatefromjpeg($source_image_URL);
    list($width, $height) = getimagesize($source_image_URL);
    $percent1 = $width / $maxx; //6,35
    $percent2 = $height / $maxy; // 4,76
    $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);
    imagejpeg($dest_image);
    imagedestroy($dest_image);
    imagedestroy($source_image);

    come risultato ottengo una serie di caratteri stranissimi al posto della immagine.. come mai?

  2. #2
    ecco lo script per intero

    $maxx = 126;
    $maxy = 126;
    $source_image_URL = "http://www.gayspace.it/fotoutenti/$nickk/foto1.jpeg";
    $source_image = imagecreatefromjpeg($source_image_URL);
    list($width, $height) = getimagesize($source_image_URL);
    $percent1 = $width / $maxx; //6,35
    $percent2 = $height / $maxy; // 4,76
    $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);

    ed ecco cosa mi risulta:

    Warning: Cannot modify header information - headers already sent by (output started at /web/htdocs/www.gayspace.it/home/profilo/profilo_foto3.php:124) in /web/htdocs/www.gayspace.it/home/profilo/profilo_foto3.php on line 222
    ÿØÿàJFIFÿþ>CREATOR: gd-jpeg v1.0 (using IJG JPEG v62), default quality ÿÛC   $.' ",#(7),01444

    '9=82<.342ÿÛC  2!!
    ÿÀ_~"ÿÄ ÿĵ

    aiutooooooo

  3. #3

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.