Seguendo la discussione e andando a tentativi ho cambio la classe SaveProportionateImage come proponeva un altro utente ( la copio sotto) e ora funziona.
Ciao
Roberto Fiordaliso
Questa non funzionava e mi faceva le immagini nere:
function SaveProportionateImage ($filename , $quality , $height ){
$dest_height = $height ;
$ratio = $this -> src_height / $dest_height ;
$dest_image = imagecreatetruecolor ( $this -> src_width / $ratio ,$dest_height );
imagecopyresampled ($dest_image ,$this -> src_image , 0, 0, 0, 0,
$this -> src_width†/ $ratio ,
$this -> src_height / $ratio ,
$this -> src_width ,
$this -> src_height );
imagejpeg($dest_image, $filename, $quality);
imagedestroy ($dest_image );
}
Questa funziona:
function SaveProportionateImage($filename, $quality, $height)
{
if ($this->src_height > $this->src_width)
{
$dest_height = $height;
}
else
{ $dest_height = ceil(($this->src_width * $height) / $this->src_height);
}
echo " $dest_height ";
$ratio = $this->src_height / $dest_height;
$dest_image = imagecreatetruecolor( $this->src_width / $ratio,$dest_height);
imagecopyresampled($dest_image, $this->src_image, 0, 0, 0, 0,$this->src_width / $ratio,$this->src_height / $ratio,$this->src_width,$this->src_height);
imagejpeg($dest_image, $filename, $quality);
imagedestroy($dest_image);
}