Bug #51315 [NEW]: imagettfbbox randomly don't work

From: Date: Wed, 17 Mar 2010 19:55:29 +0000
Subject: Bug #51315 [NEW]: imagettfbbox randomly don't work
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-148726@lists.php.net to get a copy of this message
From:             
Operating system: Debian GNU/Linux 5.0
PHP version:      5.3.2
Package:          GD related
Bug Type:         Bug
Bug description:imagettfbbox randomly don't work

Description:
------------
Hi,

I have ugraded PHP 5.2 to PHP 5.3.2 on my Debian server and I have found a
bug width ths function imagettfbbox.

Sometimes the text don't show on the image generated :

http://www.exinsidephp.com/cache/example.png

If I refresh the page (Ctrl+F5) another image don't display the text :

http://www.exinsidephp.com/cache/example2.png

Any error on PHP Blog, any error on syslog or kernel log... I haven't find
any trace of error. Someone have the same issue ?

The PHP Package come from http://www.dotdeb.org/ website. The
list of
modules installed (dpkg -l | grep php5) :

ii  libapache2-mod-php5 5.3.2-0.dotdeb.1                                   
                            
ii  php5                                 5.3.2-0.dotdeb.1                  
                                             
ii  php5-cli                                5.3.2-0.dotdeb.1               
                                                
ii  php5-common                             5.3.2-0.dotdeb.1               
                                                
ii  php5-curl                               5.3.2-0.dotdeb.1               
                                                
ii  php5-dev                                5.3.2-0.dotdeb.1               
                                                
ii  php5-gd                                 5.3.2-0.dotdeb.1               
                                                
ii  php5-geoip                              5.3.2-0.dotdeb.1               
                                                
ii  php5-imagick                            5.3.2-0.dotdeb.1               
                                                
ii  php5-imap                               5.3.2-0.dotdeb.1               
                                                
ii  php5-mcrypt                             5.3.2-0.dotdeb.1               
                                                
ii  php5-mysql                              5.3.2-0.dotdeb.1               
                                                
ii  php5-suhosin                            5.3.2-0.dotdeb.1               
                                                
ii  php5-xcache                             5.3.2-0.dotdeb.1               
                                                

Test script:
---------------
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Content-Type: image/png');
		
$image = imagecreate(55,15);
imagecolorallocate($image, 0,0,0);

if($get->getValue('temp2'))
	$texte =
$get->getValue('temp1').'/'.$get->getValue('temp2').'
°C';
else
	$texte = $get->getValue('temp1').' °C';

$tab = imagettfbbox(8,0,Config::getCons('PATH_CACHE').'font/verdana.TTF',
$texte);
$text_x = (55-($tab[2]-$tab[6]))/2;
$text_y = (15-($tab[1]-$tab[5]))/2+9;

//$color = imagecolorallocate($image, 2,119,186);
$color = imagecolorallocate($image, 255,255,255);
imagettftext($image,8,0,$text_x,$text_y,$color,Config::getCons('PATH_CACHE').'font/verdana.TTF',$texte);

imagepng($image);


-- 
Edit bug report at http://bugs.php.net/bug.php?id=51315&edit=1
-- 
Try a snapshot (PHP 5.2):            http://bugs.php.net/fix.php?id=51315&r=trysnapshot52
Try a snapshot (PHP 5.3):            http://bugs.php.net/fix.php?id=51315&r=trysnapshot53
Try a snapshot (PHP 6.0):            http://bugs.php.net/fix.php?id=51315&r=trysnapshot60
Fixed in SVN:                        http://bugs.php.net/fix.php?id=51315&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=51315&r=needdocs
Fixed in release:                    http://bugs.php.net/fix.php?id=51315&r=alreadyfixed
Need backtrace:                      http://bugs.php.net/fix.php?id=51315&r=needtrace
Need Reproduce Script:               http://bugs.php.net/fix.php?id=51315&r=needscript
Try newer version:                   http://bugs.php.net/fix.php?id=51315&r=oldversion
Not developer issue:                 http://bugs.php.net/fix.php?id=51315&r=support
Expected behavior:                   http://bugs.php.net/fix.php?id=51315&r=notwrong
Not enough info:                     http://bugs.php.net/fix.php?id=51315&r=notenoughinfo
Submitted twice:                     http://bugs.php.net/fix.php?id=51315&r=submittedtwice
register_globals:                    http://bugs.php.net/fix.php?id=51315&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=51315&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=51315&r=dst
IIS Stability:                       http://bugs.php.net/fix.php?id=51315&r=isapi
Install GNU Sed:                     http://bugs.php.net/fix.php?id=51315&r=gnused
Floating point limitations:          http://bugs.php.net/fix.php?id=51315&r=float
No Zend Extensions:                  http://bugs.php.net/fix.php?id=51315&r=nozend
MySQL Configuration Error:           http://bugs.php.net/fix.php?id=51315&r=mysqlcfg



Thread (16 messages)

« previous php.bugs (#148726) next »