image resize

  • Creatore Discussione Creatore Discussione queer
  • Data di inizio Data di inizio

queer

Nuovo Utente
25 Lug 2006
5
0
0
eseguo questo script


$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 :dipser: :dipser: :dipser:
 

Discussioni simili