php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #59610 pseudo image caption wont allow transparent background
Submitted: 2011-02-07 06:38 UTC Modified: 2011-05-06 07:07 UTC
From: junkboypaul at hotmail dot com Assigned:
Status: Not a bug Package: imagick (PECL)
PHP Version: 5.2.6 OS: linux
Private report: No CVE-ID: None
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
28 + 27 = ?
Subscribe to this entry?

 
 [2011-02-07 06:38 UTC] junkboypaul at hotmail dot com
Description:
------------
I tried generating caption text image with transparent background.

Reproduce code:
---------------
<?php
$image_width = 200;
$image_height = 200;
$text = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
		 Mauris lectus mi, mattis non, euismod vel, sagittis nec, ipsum.";
$im = new Imagick();

$im->newPseudoImage( $image_width, $image_height, "caption:" . $text );
$im->setImageVirtualPixelMethod(Imagick::VIRTUALPIXELMETHOD_TRANSPARENT);
$im->setImageMatte(true);
$im->borderImage( 'black', 1, 1 );
$im->colorizeImage('#FF0000',0.3);
$im->setImageFormat( "png") ;
header( "Content-Type: image/png" );
echo $im;


Expected result:
----------------
Transparent background with red text and red border

Actual result:
--------------
solid white background with red text and red border

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-02-07 06:46 UTC] mkoppanen@php.net
Try calling:

$im->setBackgroundColor("transparent");

before the newPseudoImage call. Does it help?
 [2011-02-07 08:29 UTC] junkboypaul at hotmail dot com
Now it's showing a solid red background. I need it to have a transparent background with red text.
 [2011-05-06 07:07 UTC] mkoppanen@php.net
Sorry, but your problem does not imply a bug in PECL itself.  For a
list of more appropriate places to ask for help using PECL, please
visit http://pecl.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PECL.

<?php
$image_width = 200;
$image_height = 200;
$text = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
                 Mauris lectus mi, mattis non, euismod vel, sagittis nec, ipsum.";
$im = new Imagick();
$im->setBackgroundColor("transparent");
$im->newPseudoImage( $image_width, $image_height, "caption:" . $text );
$im->paintOpaqueImage ("black", "red", 100000);

$im->setImageFormat( "png") ;
header( "Content-Type: image/png" );
echo $im;
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Oct 31 22:01:27 2024 UTC