1

次のコードでimagemagickを使用してpngを作成しようとしました。

<?php
/* Create some objects */
$image = new Imagick();
$draw = new ImagickDraw();
$pixel = new ImagickPixel( 'gray' );

/* New image */
$image->newImage(800, 75, $pixel);

/* Black text */
$draw->setFillColor('black');

/* Font properties */
$draw->setFont('Oxin_free_promo.ttf');
$draw->setFontSize( 30 );

/* Create text */
$image->annotateImage($draw, 10, 45, 0, 'The quick brown fox jumps over the lazy dog');

/* Give image a format */
$image->setImageFormat('png');

/* Output the image with headers */
header('Content-type: image/png');
echo $image;

しかし、私は以下のエラーを受け取り続けます。/ usr / local / zend / tmp /は777にchmodされ、daemon:zendによって所有されます。magick-*は存在しません。何か案は?

httpd: FreeType library is not available `/Users/gareth.williams/Sites/_tests/texttoimg/Oxin_free_promo.ttf'.
httpd: Postscript delegate failed `/usr/local/zend/tmp/magick-tmfNBDIx': No such file or directory.
PHP Fatal error:  Uncaught exception 'ImagickException' with message 'Unable to annotate image'
4

1 に答える 1