
Imagick::identifyImage 함수의 결과에서 파일의 MIME 타입을 얻는 방법은 다음과 같습니다.
#hostingforum.kr
php
$mimeType = $imagick->getImageMimeType();
이미지의 크기, 해상도, 파일 형식 등과 같은 정보를 얻는 방법은 다음과 같습니다.
#hostingforum.kr
php
$width = $imagick->getImageWidth();
$height = $imagick->getImageHeight();
$format = $imagick->getImageFormat();
해당 함수의 결과에서 이미지의 해상도는 다음과 같이 얻을 수 있습니다.
#hostingforum.kr
php
$resolutionX = $imagick->getImageResolutionX();
$resolutionY = $imagick->getImageResolutionY();
이미지 파일의 정보를 얻기 위해 Imagick::identifyImage 함수를 사용할 때, 다음과 같은 예제를 참고할 수 있습니다.
#hostingforum.kr
php
$imagick = new Imagick('image.jpg');
$mimeType = $imagick->getImageMimeType();
$width = $imagick->getImageWidth();
$height = $imagick->getImageHeight();
$format = $imagick->getImageFormat();
$resolutionX = $imagick->getImageResolutionX();
$resolutionY = $imagick->getImageResolutionY();
echo "MIME 타입: $mimeTypen";
echo "이미지 크기: $width x $heightn";
echo "이미지 형식: $formatn";
echo "해상도: $resolutionX dpi x $resolutionY dpin";
2025-04-27 08:54