2012-02-24 2 views
0

PHP 복사 기능을 사용하여 디렉토리에 업로드 한 후 이미지를 복사하고 있습니다. 이미지를 복사하기 전에 크기를 조정할 수 있습니까? 내 포럼에서 사용하기 위해 크기를 80x80으로 조정해야합니다.복사하기 전에 크기를 조정 하시겠습니까?

//lets move a copy to the img dir for the forum 
$avatar_tmp_file = 'forum/img/avatars/'.$_SESSION['forum_uid']. '.jpg'; 
copy($_FILES['file']['tmp_name'], $avatar_tmp_file); 

어떤 제안 : 내 사본을 전화 드렸습니다 방법은 다음과

은?

+0

http://php.net/manual/en/function.imagecopyresampled.php 올바른 방향으로 날 포인트 – j08691

답변

3

예 이렇게하는 방법이 있습니다. 예를 들어 imagick을 사용합니다.

$image=new Imagick(); 
$image->readImage($_FILES['file']['tmp_name']); 
$image->thumbnailImage(80,80); 
$image->writeImage($avatar_tmp_file); 
+0

... 감사합니다! – Paul

관련 문제