Hi Vladimir, On Tuesday 16 March 2010 16:02:21 Vladimir Stavrinov wrote: > I have found the source of problem. It is chain of errors. It is right > that imagepstext() fail. Why? Because it take boolean "FALSE" instead of > image resource as first parameter. This value is returned by > imagecreate() where height and width is calculated from imagepsbbox(), > but this last function return wrong value for left x-coordinate if > mt_rand() is used to generate random angle. Don't understand why. Here > is short example: > > <?php > $size = 64; > $code = ($argv[1]) ? $argv[1] : date("r"); > $angle = 0; > $angle = mt_rand(20,40)*((mt_rand(0,1)) ? 1 : -1); > print "\$angle = " . $angle . "\n"; > $font = imagepsloadfont("/usr/share/fonts/type1/gsfonts/c059036l.pfb"); > print_r(imagepsbbox( $code, $font, $size, 0, 0, $angle )); > ?> > > But when purge suhosin this problem go away. Thus there are something > wrong in mt_rand() in conjunction with suhosin.
if you are using testing/unstable on i386, could please test http://ftp.cyconet.org/debian/archive/official/php-suhosin/0.9.30-1/php5- suhosin_0.9.30-1_i386.deb ? There are two changelog entries which might solve your problem: - Fixed missing return (1); in random number generator replacements - Fixed random number generator replacement error case behaviour in PHP 5.3.x Thanks and with kind regards, Jan. -- Never write mail to <w...@spamfalle.info>, you have been warned! -----BEGIN GEEK CODE BLOCK----- Version: 3.12 GIT d-- s+: a C+++ UL++++ P+ L+++ E--- W+++ N+++ o++ K++ w--- O M V- PS PE Y++ PGP++ t-- 5 X R tv- b+ DI D+ G++ e++ h---- r+++ y++++ ------END GEEK CODE BLOCK------
signature.asc
Description: This is a digitally signed message part.