$simg_width){ $simg_height = $img_height * ($simg_width/$img_width); //자동 비율생성 : 높이 }else{ $ft_size = intval($ft_size * ($img_width/$simg_width)); if($ft_size%2 == 1){$ft_size = $ft_size - 1;} $ft_psn_x = intval($ft_psn_x * ($img_width/$simg_width)); $ft_psn_y = intval($ft_psn_y * ($img_width/$simg_width)); $simg_width = $img_width; $simg_height = $img_height; } $img_im = imagecreatefromjpeg($img_file); //원본 이미지: jpg $simg_im = imagecreatetruecolor($simg_width, $simg_height); imagecopyresampled($simg_im, $img_im, 0, 0, 0, 0, $simg_width, $simg_height,$img_width, $img_height); //이미지를 리사이즈한다. if($simg_str){ $color_000000 = imagecolorallocate($simg_im, 0, 0, 0); //색상 : 검정 $color_FFFFFF = imagecolorallocate($simg_im, 0xFF, 0xFF, 0xFF); //색상 : 흰색 // $simg_str = iconv("EUC-KR","UTF-8",$simg_str); // UTF-8로 한글 변경 @imagettftext($simg_im, $ft_size, 0, $simg_width-$ft_psn_x, $simg_height-$ft_psn_y, $color_000000, "font/GOTHICB.TTF",$simg_str); //글자 적기 @imagettftext($simg_im, $ft_size, 0, $simg_width-$ft_psn_x-3, $simg_height-$ft_psn_y, $color_FFFFFF, "font/GOTHICB.TTF",$simg_str); //글자 적기 } imagejpeg($simg_im,$simg_name,80); //원본 이미지: jpg // 메모리에 있는 그림 삭제 imagedestroy($img_im); imagedestroy($simg_im); } ?>