imagecreatetruecolor ecc

Versione Completa   Stampa   Cerca   Utenti   Iscriviti     Condividi : FacebookTwitter
|Alex|
00mercoledì 14 settembre 2005 15:59
 -1)
                   unset($files1[$ix1]);
           while(($ix1 = array_search('..',$files1)) > -1)
                   unset($files1[$ix1]);
  sort($files1);
  foreach ($files1 as $v1) {

$end_img = "/membri2/user/foto/$nick/$v1";
$start_img = "/membri2/user/admin/foto/$nick/$v1";
$size = getimagesize("foto/$nick/$v1");
	       $height = $size[1];
	       $width = $size[0];
	       $percent = ($size[0] / $width);

if ($size[0] > 400 ) {
$nuova_x = 400;
$height = ($size[1] / $percent);
$nuova_y = $height;
}
else {
$nuova_x = $height;
$nuova_y = $height;
}

if (!file_exists($end_img))
{
$im = imagecreatefromjpeg ($start_img);
if ($im)
{
$dst_img=imagecreatetruecolor($nuova_x,$nuova_y);
imagecopyresampled($dst_img,$im,0,0,0,0,$nuova_x,$nuova_y,ImageSX($im),ImageSY($im));
imagejpeg($dst_img, $end_img);
imagedestroy($dst_img);
imagedestroy($im);
}
}
 $i++;
     }
foreach ($files1 as $v1) {

$end_img = "/membri2/user/foto/$nick/thumb/$v1";
$start_img = "/membri2/user/admin/foto/$nick/$v1";
$size = getimagesize("foto/$nick/$v1");
	       $height = $size[1];
	       $width = $size[0];
	       $percent = ($size[0] / $width);

if ($size[0] > 110 ) {
$nuova_x = 110;
$height = ($size[1] / $percent);
$nuova_y = $height;
}
else {
$nuova_x = $height;
$nuova_y = $height;
}
if (!file_exists($end_img))
{
$im = imagecreatefromjpeg ($start_img);
if ($im)
{
$dst_img=imagecreatetruecolor($nuova_x,$nuova_y);
imagecopyresampled($dst_img,$im,0,0,0,0,$nuova_x,$nuova_y,ImageSX($im),ImageSY($im));
imagejpeg($dst_img, $end_img);
imagedestroy($dst_img);
imagedestroy($im);
}
}
 $i++;
     }
     foreach ($files1 as $v1) {

          unlink("$dir1/$v1");
          $i++;
          }
          rmdir("$dir1");

    }
echo "Scheda inserita con successo
"; echo "Indietro"; ?>

Qualcuno sa come posso fixare il resize? ogni tanto mi scazza ma non so perchè ... non mi linkate php.net che lo conosco a memoria [SM=x39897]
|Alex|
00giovedì 15 settembre 2005 11:06
risolto .... errore stupido nel codice
g
00giovedì 15 settembre 2005 13:30
Re:

Scritto da: |Alex| 15/09/2005 11.06
risolto .... errore stupido nel codice


$size = getimagesize("foto/$nick/$v1");

$height = $size[1];

$width = $size[0];

$percent = ($size[0] / $width);


if ($size[0] > 400 ) {

$nuova_x = 400;

$height = ($size[1] / $percent);

$nuova_y = $height;

}

else {

$nuova_x = $height;

$nuova_y = $height;

}




Qui? [SM=x39990]
|Alex|
00giovedì 15 settembre 2005 13:39
si
Questa è la versione 'lo-fi' del Forum Per visualizzare la versione completa clicca qui
Tutti gli orari sono GMT+01:00. Adesso sono le 08:12.
Copyright © 2000-2024 FFZ srl - www.freeforumzone.com