$width){ $width2 = 320*$width/$height; $out = ImageCreateTrueColor($width2, 320); imagecopyresampled($out, $source,0,0,0,0, $width2, 320, $width, $height); }else{ $width2 = 240*$width/$height; $out = ImageCreateTrueColor($width2, 240); imagecopyresampled($out, $source,0,0,0,0, $width2, 240, $width, $height); $out = imagerotate($out, $degrees, 0); } }//if($_GET['thum']=='t'){ END }else{ if($_GET['thum']=='t'){//220X165 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // PC用サムネール表示 start // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * if($height<$width){ $width2 = 220*$width/$height; $out = ImageCreateTrueColor($width2, 220); imagecopyresampled($out, $source,0,0,0,0, $width2, 220, $width, $height); $rotate = $out; $x=($width2-220)/2; $y=(220-165)/2; }else{ $height2 = 220*$height/$width; $out = ImageCreateTrueColor(220, $height2); imagecopyresampled($out, $source,0,0,0,0, 220, $height2, $width, $height); $rotate = $out; $x=0; $y=(height2-165)/2; } $width = ImageSx($rotate); $height = ImageSy($rotate); $out = imagecreatetruecolor(220, 165); imagecopy($out, $rotate,0, 0, 0, 0, 220, 165); }elseif($_GET['thum']=='ss'){//65X65 if($height<$width){ $width2 = 65*$width/$height; $out = ImageCreateTrueColor($width2, 65); imagecopyresampled($out, $source,0,0,0,0, $width2, 65, $width, $height); $rotate = $out; $x=($width2-65)/2; $y=0; }else{ $height2 = 65*$height/$width; $out = ImageCreateTrueColor(65, $height2); imagecopyresampled($out, $source,0,0,0,0, 65, $height2, $width, $height); $rotate = $out; //$x=0; // $y=(height2-65)/2; } //$width = ImageSx($rotate); //$height = ImageSy($rotate); $out = imagecreatetruecolor(65, 65); imagecopy($out, $rotate,0, 0, 0, 0, 65, 65); }else{ if($height<480||$width<640){ $out = ImageCreateTrueColor($width, $height); imagecopy($out, $source,0,0, 0, 0, $width, $height); $rotate = $out; }else{ if($height>$width){ $width2 = 480*$width/$height; $out = ImageCreateTrueColor($width2, 480); imagecopyresampled($out, $source,0,0,0,0, $width2, 480, $width, $height); $rotate = $out; }else{ $height2 = 640*$height/$width; $out = ImageCreateTrueColor(640, $height2); imagecopyresampled($out, $source,0,0,0,0, 640, $height2, $width, $height); $rotate = $out; } } }//if($_GET['thum']=='t'){ END } // 出力 header("Content-type: image/jpeg"); imagejpeg($out); @imagedestroy($out); @imagedestroy($rotate); } ?>