ID:               21729
 Updated by:       [EMAIL PROTECTED]
 Reported By:      [EMAIL PROTECTED]
 Status:           Open
 Bug Type:         GD related
 Operating System: Linux
 PHP Version:      4.3.0
 New Comment:

Hello,

Can you provide a small script to reproduce your problem, this function
works like a charm here.
This line:
$tc  = ImageColorAllocate ($im, $colors[$color][0],
$colors[$color][1], $colors[$color][2]);
can be your problem. Check the $color array, or set
error_reporting(E_ALL); to see if they are initialized correctly (btw,
use always this flag to develop).

Second point, ImageAlphaBlending is useless in your case,
ImageColorAllocate allocates a color with an opaque alpha channel.

thank's for your interest,

pierre


Previous Comments:
------------------------------------------------------------------------

[2003-01-19 07:27:08] [EMAIL PROTECTED]

Don't show the text also with the latest CVS version.

------------------------------------------------------------------------

[2003-01-18 13:17:24] [EMAIL PROTECTED]

Please try using this CVS snapshot:

  http://snaps.php.net/php4-STABLE-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php4-win32-STABLE-latest.zip



------------------------------------------------------------------------

[2003-01-18 11:17:51] [EMAIL PROTECTED]

This code work fine on PHP 4.2.3 compiled with gd2.0.4, but give a
image without text with php 4.3 compiled with internal gd support. I
have this problem only in the image resized and not with the original
image:

    if($width==$isize[0]) //original size: this work
    {
        $im = ImageCreateFromPNG ("bottoni/".$tipo_bottone);
    }
    else // to resize: don't work
    {
        $im1 = ImageCreateFromPNG("bottoni/".$tipo_bottone);
        $im=ImageCreateTrueColor($width, $isize[1]);
        ImageCopy($im, im1,0,0,0,0,$margin_width,$isize[1]);
        ImageCopyResized($im, $im1, $margin_width, 0, $margin_width, 0,
$width, $isize[1], round($isize[0]-($margin_width * 2),0), $isize[1]);
        ImageCopy($im,
$im1,$margin_width+$width-1,0,$isize[0]-$margin_width,0,$margin_width,$isize[1]);
        ImageDestroy($im1);
    }
    ImageAlphaBlending($im, true);
    $tc  = ImageColorAllocate ($im, $colors[$color][0],
$colors[$color][1], $colors[$color][2]);
    imagettftext($im, $size, 0, $center, $margin_height, $tc,
$currpath."/fonts/".$font,$testo);
    ImageAlphaBlending($im, false);
    header("Content-Type: image/png\n\n");
    ImagePNG($im);


Thank for support

Paolo Morandi

------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=21729&edit=1

Reply via email to