
Gmagick 클래스를 사용하여 이미지를 처리할 때, getimagefilename 함수를 사용하여 이미지를 저장할 때 이미지 이름을 지정할 수 있습니다.
이미지 이름을 지정할 때, $image->getimagefilename() 함수를 사용하여 이미지를 저장할 수 있습니다.
예를 들어, 다음과 같이 사용할 수 있습니다.
#hostingforum.kr
php
$image = new Gmagick('input.jpg');
$image->resizeImage(300, 300, Gmagick::FILTER_LANCZOS, 1);
$image->setImageFormat('jpg');
$image->getimagefilename('output'); // 'output1.jpg', 'output2.jpg' 등으로 저장
또는, 특정 변수를 사용하여 이미지를 저장할 때 이름을 지정할 수 있습니다.
예를 들어, 다음과 같이 사용할 수 있습니다.
#hostingforum.kr
php
$image = new Gmagick('input.jpg');
$image->resizeImage(300, 300, Gmagick::FILTER_LANCZOS, 1);
$image->setImageFormat('jpg');
$count = 1;
$image->getimagefilename("output$count.jpg");
$count++;
이러한 방법으로, 이미지 이름을 지정할 수 있습니다.
2025-03-21 03:44