Ciao ragazzi,
uso questo codice per creare delle miniature però su Aruba non funziona.
Forse c'è qualche codice che non è compatibile?
Codice PHP:
<?php
$nomeimage = $_POST['uppato'];
$source_path = "public/Foto/";
$destination_path = 'public/Mini/';
$quanto = 130;
list($width, $height, $type, $attr) = getimagesize($source_path.$nomeimage);
if($type==2){
if($width > $height)
{
$new_width=$quanto;
$new_height=($quanto*$height)/$width;
$new_height=number_format($new_height, 0);
}
else if($height > $width)
{
$new_height=$quanto;
$new_width=($quanto*$width)/$height;
$new_width=number_format($new_width, 0);
}
else if($height == $width)
{
$new_width = 130;
$new_height = 130;
}
$compression=100;
$destimg=imagecreatetruecolor($new_width,$new_height) or die("Problemi nelle creazioni dell'immagine");
$srcimg=ImageCreateFromJPEG($source_path.$nomeimage) or die("Problemi nell'aprire l'immagine");
ImageCopyResampled($destimg,$srcimg,0,0,0,0,$new_width,$new_height,ImageSX($srcimg),ImageSY($srcimg)) or die("Problemi nel ridimensionamento");
ImageJPEG($destimg, $destination_path.$nomeimage, $compression) or die("Problemi nel salvataggio");
}
$TextVariable = '&end1=si';
echo $TextVariable;
?>