-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"; ?>
Scritto da: |Alex| 15/09/2005 11.06 risolto .... errore stupido nel codice