Ciao e grazie per il link, tuttavia non riesco a farlo funzionare..
Ho usato la funzione per creare delle anteprime di dimensioni ridotte mantenndo la proporzione
codice:
function OutThumb(){
$size = getimagesize($src);
if( $size[2] == 2 ){$im = @imagecreatefromjpeg($src);}
elseif( $size[2] == 1 ){$im = @imagecreatefromgif($src);}
elseif( $size[2] == 3 ){$im = @imagecreatefrompng($src);}
if( $size[0]>$l or $size[1]>$l ){
$centerX = $size[0]/2;
$centerY = $size[1]/2;
if( $size[0] > $size[1] ){
$luy = 0;
$lux = $centerX-$centerY;
$rdy = $size[1];
$rdx = $size[1];
}
else{
$lux = 0;
$luy = $centerY-$centerX;
$rdx = $size[0];
$rdy = $size[0];
}
if( (GDVersion() == 2) AND ($size[2] != 1) ){
$new = imagecreatetruecolor($l, $l);
imagecopyresampled($new, $im, 0, 0, $lux, $luy, $l, $l, $rdx, $rdy);
}
else{
$new = imagecreate($l, $l);
imagecopyresized($new, $im, 0, 0, $lux, $luy, $l, $l, $rdx, $rdy);
}
}
else{
$new &= $im;
}
header('Content-Type: ' . $size['mime']);
if( $size[2] == 2 ){@imagejpeg($new, $fileOut, 100);}
elseif( $size[2] == 1 ){@imagegif($new, $fileOut);}
elseif( $size[2] == 3 ){@imagepng($new, $fileOut);}
@imagedestroy($im);
@imagedestroy($new);
}
?>
ke ho messo nella parte superiore della pagina..
Poi, dove necessario ho usato il codice:
codice:
<?php
$query = "SELECT * FROM $fototable WHERE categoria='$categpred'";
$result = mysql_query($query, $conn) or die("errore nella query:" . mysql_error());
unset($query);
$num=0;
while($row = mysql_fetch_array($result)){
$src = $row["fotolink"];
$nome = $row["nome"];
$rep = "../yoursite/" . "$blogname" . "/" . "$categpred";
$l = "100px";
$newlink = OutThumb($src, $l);
echo"
ultimateshow[$num]=[\"$newlink\", \"foto.php?bl=$blogname&rep=$rep&image=$nome\", \"\"]";
$num++;
} // CHIUSURA WHILE
?>
Tuttavia mi da un errore....
codice:
Warningb>: Cannot modify header information - headers already sent by (output started at /web/htdocs/www.nomesito.com/home/hosted/nebula/blog/blogsx.php:143) in /web/htdocs/www.nomesito.com/home/hosted/nebula/blog/blogsx.php on line 35
Ti ho evidenziato le parti più importanti in bold per cercare di farti capire...
Grazie Mille