php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #59448 Unable to annotate image
Submitted: 2010-10-04 06:45 UTC Modified: 2010-10-04 13:45 UTC
From: s dot m dot boser at gmail dot com Assigned:
Status: Closed Package: imagick (PECL)
PHP Version: 5.2.5 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: s dot m dot boser at gmail dot com
New email:
PHP Version: OS:

 

 [2010-10-04 06:45 UTC] s dot m dot boser at gmail dot com
Description:
------------
Hi,

Please check the link http://bannermaken.nl/magic/. I am getting "Fatal error: Uncaught exception 'ImagickException' with message 'Unable to annotate image' in /home/p21628/domains/bannermaken.nl/public_html/magic/index.php:15 Stack trace: #0 /home/p21628/domains/bannermaken.nl/public_html/magic/index.php(15): Imagick->annotateimage(Object(ImagickDraw), 10, 10, 0, 'Hello World') #1 {main} thrown in /home/p21628/domains/bannermaken.nl/public_html/magic/index.php on line 15".

But the same code is running fine at my local xampp(windows) server. I have checked various time, its not due to font. As I comment out the font, so it should take system default font and give me the desired output.

Reproduce code:
---------------
<?php
$image = new Imagick('1.jpg');
$draw = new ImagickDraw();
$draw->setFontSize(40);
$draw->setFillColor('#FF0000');
$image->annotateImage($draw, 10, 10, 0, 'Hello World');
$draw->clear();
$draw->destroy();
$image->setImageFormat('png');
header('Content-type: image/png');
echo $image;
?>

Or

http://bannermaken.nl/magic/

Expected result:
----------------
This should print Hello Word in the image. Its working fine from Windows XAMPP server. But getting FATAL error 'Unable to annotate image' while I am running from LINUX server.



Actual result:
--------------
Getting a FATAL error.

Fatal error: Uncaught exception 'ImagickException' with message 'Unable to annotate image' in /home/p21628/domains/bannermaken.nl/public_html/magic/index.php:15 Stack trace: #0 /home/p21628/domains/bannermaken.nl/public_html/magic/index.php(15): Imagick->annotateimage(Object(ImagickDraw), 10, 10, 0, 'Hello World') #1 {main} thrown in /home/p21628/domains/bannermaken.nl/public_html/magic/index.php on line 15

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-10-04 13:45 UTC] s dot m dot boser at gmail dot com
Its ok now. I have solved the issue
 [2012-02-27 02:17 UTC] jsjwangjianli at 126 dot com
hi,please help me.
PHP Fatal error:  Uncaught exception 'ImagickException' with message 'Unable to annotate image' in /data/web/htdocs/pictureeditor/001/001.php:18
Stack trace:
#0 /data/web/htdocs/pictureeditor/001/001.php(18): Imagick->annotateimage(Object(ImagickDraw), 10, 45, 0, 'The quick brown...')
#1 {main}
  thrown in /data/web/htdocs/pictureeditor/001/001.php on line 18

the same code is running fine at my local wampserve(windows) server.
LINUX server running has error.

code:
<?php
$image = new Imagick();
$draw = new ImagickDraw();
$pixel = new ImagickPixel( 'gray' );
$image->newImage(800, 75, $pixel);
$draw->setFillColor('black');
//$draw->setFont('Bookman-DemiItalic');
$draw->setFontSize( 30 );
$image->annotateImage($draw, 10, 45, 0, 'The quick brown fox jumps over the lazy dog');
$image->setImageFormat('png');

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

can you help me?thanks very mutch.
email:jsjwangjianli@126.com
 [2012-02-27 03:16 UTC] jsjwangjianli at 126 dot com
i got it,my friend helped me.
my imagick Plug-in is not Completed.
ImageMagick.x86_64 is ok to the problem.
 [2012-10-11 15:32 UTC] aditya19897 at gmail dot com
hi i was facing the same problem, 

but i just made changes to the font setting line "$draw->setFont('Bookman-
DemiItalic');"in the script i.e use only those fonts that are installed on your 
server/pc or for 
testing purpose remove the font setting line all together

hope this solves your problem
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 17 03:01:32 2024 UTC