Im php imagick을 사용하여 이미지에 텍스트를 쓰려고합니다. 그것은 내 서버에서 정상적으로 실행되지만 내 맥북에서 실행하는 데 문제가 있습니다.PHP imagick annotate setFont가 최대 실행 시간을 초과합니다.
코드 : 난 내 맥북에서이 프로그램을 실행할 때
/* Text to write */
$text = "Hello World!";
/* Create Imagick objects */
$image = new Imagick();
$draw = new ImagickDraw();
$color = new ImagickPixel('#000000');
$background = new ImagickPixel('none'); // Transparent
/* Font properties */
$draw->setFont('Arial');
$draw->setFontSize(50);
$draw->setFillColor($color);
$draw->setStrokeAntialias(true);
$draw->setTextAntialias(true);
/* Get font metrics */
$metrics = $image->queryFontMetrics($draw, $text);
/* Create text */
$draw->annotation(0, $metrics['ascender'], $text);
/* Create image */
$image->newImage($metrics['textWidth'], $metrics['textHeight'], $background);
$image->setImageFormat('png');
$image->drawImage($draw);
/* Save image */
header("Content-type: image/png");
echo $image;
는, 프로세서가 100 %에 걸리면, 그 과정이 메시지와 함께 30 초 살해 : 초과 30 초 최대 실행 시간 13 번 줄에서 $ draw-> setFont();
는 ... 답변 주셔서 감사합니다
에 글꼴에 대한 전체 경로를 제공 귀하의 서버와 맥북에서 동일합니까? –
맥북 모듈 버전 : 3.0.1, im 버전 : 6.5.7-0, 서버 모듈 : 2.1.1-rc1, im : 6.3.7 – Kukosk