
Imagick::resizeImage 함수의 두 번째 인자로 width와 height를 지정할 수 있습니다. 이 함수의 인자는 width와 height의 순서가 상관이 없으며, width가 height보다 큰 경우 width를 height로 지정하는 것이 맞습니다.
예를 들어, width가 800이고 height가 600인 경우, Imagick::resizeImage 함수의 두 번째 인자는 다음과 같이 지정할 수 있습니다.
#hostingforum.kr
php
$imagick->resizeImage(800, 600);
Imagick::resizeImage 함수의 return 값은 boolean으로 오류가 없을 경우 true 또는 false를 반환합니다. 오류가 발생한 경우에는 ImagickException 예외가 발생합니다.
예를 들어, 오류가 발생한 경우 다음과 같이 처리할 수 있습니다.
#hostingforum.kr
php
try {
$imagick->resizeImage(800, 600);
} catch (ImagickException $e) {
echo $e->getMessage();
}
ImagickException 예외의 getMessage() 메소드는 오류 메시지를 반환합니다.
2025-06-22 16:37