#21189 [Fbk->NoF]: TTF output function frose Apache

From: Date: Tue, 28 Jan 2003 04:29:50 +0000
Subject: #21189 [Fbk->NoF]: TTF output function frose Apache
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-31411@lists.php.net to get a copy of this message
 ID:               21189
 Updated by:       sniper@php.net
 Reported By:      pvy@novosoft.ru
-Status:           Feedback
+Status:           No Feedback
 Bug Type:         GD related
 Operating System: windows 2000/sp3
 PHP Version:      4.3.0RC4
 New Comment:

No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.




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

[2003-01-13 19:26:09] iliaa@php.net

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



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

[2002-12-27 11:36:44] renaud.boyer@helio-service.fr

I have problems too, the same OS (Win2k sp3) with php_gd.dll and
php_gd2.dll and php 4.2.3 & php 4.3.0RC4
php installed as an Apache 1.3.24 module
I use the gd only to produce small png, and i get error using
imagettfbbox with this script:

--------
<?php
Header("Content-type: image/png");

$angle = 0;
$font_size = 11;
$font_file="font/arial.ttf";	
$taille=imagettfbbox(1, $angle, $font_file, $text);
$hauteur = 2*$font_size;
$largeur = abs($taille[0]-$taille[4]) + 1.5*$hauteur;

$img = imagecreate($largeur,$hauteur);
		 
$bleu = imagecolorallocate($img, 57, 50, 139	
$coul_texte = imagecolorallocate($img, 255, 255, 255);	

//text alignement...
if...
//returns $x_text and $y_text

imagettftext($img, $font_size, $angle, $x_text, $y_text, $coul_texte,
$font_file, $text);
	
imagepng($img);
imagedestroy($img);
?>
---------

the results :

- php 4.2.3 with php_gd.dll
99% CPU used and a lot of ram, forced to stop apache service
nothing appears in the php error log.

- php 4.2.3 with php_gd2.dll
"Unable to find font" warning, with a relative link to the font or with
an absolute link.
no image is drawn.

- php 4.3.0RC4 with php_gd.dll
99% CPU used and a lot of ram, forced to stop apache service
nothing appears in the php error log.

- php 4.3.0RC4 with php_gd2.dll
"Could not set character size" warning... Don't know why... And the
strange thing is that sometimes the image is drawn, and sometimes not.

the script worked before on php 4.2.1, gd2, apache 1.3.?.

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

[2002-12-26 17:20:50] iliaa@php.net

Small note, TTF library is not thread safe, meaning that in Win32
enviroment it may not operate well.

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

[2002-12-26 04:55:12] pvy@novosoft.ru

Hello!
I made crash tests using WebRoller software.
I set to 10 requests my PHP code from 50 virtual clients
simultaneously, and run 40 iterations.
I test php with php_gd.dll and php_gd2.dll.
in second case apache generates error on windows console (GPF)
I use next code:
<?php
    error_reporting(E_ALL);
	$img="tab100x25.png";
	header("content-Type: image/png");
	$text ="qwe";
    $textlen = strlen($text);
	$im = ImageCreateFromPng($img);
	$tab_color = ImageColorAllocate($im, 255, 255, 255);
	$txt_color = ImageColorAllocate($im, 0,0,0);
	$itSize=GetImageSize($img);
	$t_size = 11;
    ImageFill($im, 9 , 17, $tab_color);

  	ImageTTFText($im, $t_size, 0, 10, 10, $txt_color,
	    	"arial.ttf", $text);

	ImagePng($im);
	ImageDestroy($im);
?>


after crash test my system was frosen,apache haves 99% CPU and a lot of
memory.
As next, I comment string  with ImageTTFText function and test it
again.
Apache lives!
Below I will provide output from WebRollers test results:

Results from WebRoller with TTF function:
--- Start statistics ---

--- Basic statistics ---

Min:	50.00	20.00	30.00	50.00	70.00	60.00	30.00	30.00	
Avg:	514.82	602.53	785.38	827.82	378.96	238.82	200.40	199.07	
Max:	3270.00	4990.00	6350.00	7550.00	3410.00	2680.00	510.00	560.00	

--- Network traffic details ---

Total bytes sent     :    124242
Total bytes received :    347208
Average input speed  :      1152 bytes/sec

--- Summary times ---

Virtual Clients statistics:
Count	Time	AR/S	AT/R
100	1322442	0.08	13224.42
110	1290436	0.09	11731.24
101	1320349	0.08	13072.76
101	1320809	0.08	13077.32
114	1260793	0.09	11059.59
110	1262395	0.09	11476.32
99	1234395	0.08	12468.64
101	1293280	0.08	12804.75
101	1320759	0.08	13076.82
111	1263257	0.09	11380.69

Total work time:	1337293
Total requests made:	1048

Total average time per request:	1198.4126
Total average requests per second:	0.8344

--- Errors report ---

Total 425 errors!!!
Net :6
T/O :419


--- HTTP response codes details ---

Code	Count
200	629

--- End statistics ---

Results from WebRoller without TTF function:
--- Start statistics ---
--- Basic statistics ---

Min:	60.00	110.00	90.00	100.00	100.00	100.00	50.00	40.00	
Avg:	188.26	189.40	189.84	189.44	190.40	188.78	187.64	187.96	
Max:	240.00	280.00	310.00	330.00	290.00	260.00	270.00	280.00	

--- Network traffic details ---

Total bytes sent     :    475530
Average output speed : 475530000 bytes/sec
Total bytes received :   1844000
Average input speed  :      2382 bytes/sec

--- Summary times ---

Virtual Clients statistics:
Count	Time	AR/S	AT/R
400	78002	5.13	195.01
400	78052	5.12	195.13
400	77862	5.14	194.66
400	78162	5.12	195.41
400	78262	5.11	195.66
400	78202	5.11	195.51
400	78122	5.12	195.31
400	78202	5.11	195.51
400	78232	5.11	195.58
400	77942	5.13	194.85

Total work time:	78342
Total requests made:	4000

Total average time per request:	19.5948
Total average requests per second:	51.0341

--- HTTP response codes details ---

Code	Count
200	4000
--- End statistics ---



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


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



Thread (6 messages)

« previous php.bugs (#31411) next »