ho risolto solamente perchè devo fare la miniatura quadrata se a qualcuno servo ho fatto così:
Codice PHP:
$ima=$_SESSION['upload']['percorso'].$file_upload_name;
$perc=$_SESSION['upload']['percorso'];
list($width, $height) = getimagesize($ima);
$targ_w = 96;
$targ_h = 96;
$jpeg_quality = 90;
$src = $ima;
//allerta($src);
$img_r = imagecreatefromjpeg($src);
$dst_r = imagecreatetruecolor($targ_w,$targ_h);
list($w,$h) = getimagesize($src);
$source_x=$source_y=0;
if ($width > $height) { $dst_x=$dst_y=$height; }
if ($height > $width) { $dst_x=$dst_y=$width; }
if ($height == $width) { $dst_x=$dst_y=$height; }
imagecopyresampled($dst_r,$img_r,0,0,$source_x, $source_y,$targ_w,$targ_h,$dst_x,$dst_y);
imagejpeg( $dst_r, $perc."thumb_".$file_upload_name, $jpeg_quality );
imagedestroy( $img_r );
imagedestroy( $dst_r );