print($cal->createCal()); ?>
|
// Ottengo le informazioni sull'immagine originale
list($width, $height, $type, $attr) = getimagesize($_SERVER['DOCUMENT_ROOT'].'/portale/calendario/foto/1.jpg');
// Creo la versione 230*190 dell'immagine (thumbnail)
if($width>$height){
$thumb = imagecreatetruecolor(230, 190);
$source = imagecreatefromjpeg($_SERVER['DOCUMENT_ROOT'].'/portale/calendario/foto/1.jpg');
imagecopyresized($thumb, $source, 0, 0, 0, 0, 230, 190, $width, $height);
}else{
$thumb = imagecreatetruecolor(190, 230);
@$source = imagecreatefromjpeg($_SERVER['DOCUMENT_ROOT'].'/portale/calendario/foto/1.jpg');
@imagecopyresized($thumb, $source, 0, 0, 0, 0, 190, 230, $width, $height);
}
// Salvo l'immagine ridimensionata
@imagejpeg($thumb, $_SERVER['DOCUMENT_ROOT']."/portale/calendario/foto/1b.jpg", 75);
?>
|