#50971 [Fbk-Opn]: imagettftext/imagettfbbox return wrong coordinates if angle != 0

2010-02-09 Thread sks76543210 at gmail dot com
 ID:   50971
 User updated by:  sks76543210 at gmail dot com
 Reported By:  sks76543210 at gmail dot com
-Status:   Feedback
+Status:   Open
 Bug Type: GD related
 Operating System: CentOS 5
 PHP Version:  5.3SVN-2010-02-09 (snap)
 New Comment:

The bug occurs in the two PHP versions I have available to test on
here. Perhaps I can try on a win32 box when I get to work.

PHP 5.3.3-dev compiled from src
---
GD Version: bundled (2.0.34 compatible)
Freetype Version: 2.2.1

./configure  --with-apxs2=/home/user/bin/httpd/bin/apxs
--prefix=/home/user/bin/php --with-pdo-mysql --with-zlib --with-gd
--with-gettext --with-freetype-dir --enable-gd-native-ttf



PHP 5.1.6 from centos rpms
--
GD Version: bundled (2.0.28 compatible) 
FreeType Version 2.2.1


Previous Comments:


[2010-02-09 09:53:59] paj...@php.net

Which GD library do you use? Bundled?



[2010-02-09 06:39:41] sks76543210 at gmail dot com

Description:

imagettftext() and imagettfbbox() both return wrong bounding box if the
angle is not set to 0. This sounds similar to a bug closed last year at
http://bugs.php.net/bug.php?id=43073

See http://www.yessum.org/gdbug2/ for font and samples. This bug
appears to be in 5.1.6, and has since gotten worse in the latest svn. 

Also, in 5.3.3-dev, the text doesn't seem to even be on the same
baseline on many of the angles.

Reproduce code:
---
?php
$font = './cour.ttf'; // Courier New

$im = imagecreatetruecolor(600, 600);

imagefill($im, 0, 0, imagecolorallocate($im, 224, 224, 224));
$black = imagecolorallocate($im, 0, 0, 0);
$red = imagecolorallocate($im, 255, 0, 0);

$angle = 0;
do {
$bbox = imagettftext($im, 16, $angle, 299, 299, $black, $font,
'The quick brown fox');
imagepolygon($im, $bbox, 4, $red);
$angle += 45;
} while ($angle  360);

header('content-type: image/png');
imagepng($im);

Expected result:

The bounding box should be a bounding box

Actual result:
--
The string is not contained in the bounding box.





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



#50960 [Com]: createimagefromwbmp fails to process some .bmp files (mime type: x-ms-bmp)

2010-02-08 Thread sks76543210 at gmail dot com
 ID:   50960
 Comment by:   sks76543210 at gmail dot com
 Reported By:  nirvn dot asia at gmail dot com
 Status:   Open
 Bug Type: GD related
 Operating System: windows 2003
 PHP Version:  5.3.1
 New Comment:

The gd library only supports wbmp files, not bmp. See comments at
http://php.net/manual/en/function.imagecreate.php for an
imagecreatefrombmp() function. (I have not tested it, so YMMV)


Previous Comments:


[2010-02-08 01:42:12] nirvn dot asia at gmail dot com

Description:

The GD function createimagefromwbmp() fails to process some .bmp (with
mime type x-ms-bmp).

For developers, this bmp (http://www.licadho-cambodia.org/php/test.bmp)
will show the bug.

Any chance of finding a quick fix for this one?

Reproduce code:
---
/* download http://www.licadho-cambodia.org/php/test.bmp */
$img = imagecreatefromwbmp(test.bmp')


Expected result:

The function reads the .bmp and stores the image into $img.

Actual result:
--
The function returns a warning (below) and $img is empty.

Warning: imagecreatefromwbmp() [function.imagecreatefromwbmp]:
'test.bmp' is not a valid WBMP file in ...





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



#50971 [NEW]: imagettftext/imagettfbbox return wrong coordinates if angle != 0

2010-02-08 Thread sks76543210 at gmail dot com
From: sks76543210 at gmail dot com
Operating system: CentOS 5
PHP version:  5.3SVN-2010-02-09 (snap)
PHP Bug Type: GD related
Bug description:  imagettftext/imagettfbbox return wrong coordinates if angle 
!= 0

Description:

imagettftext() and imagettfbbox() both return wrong bounding box if the
angle is not set to 0. This sounds similar to a bug closed last year at
http://bugs.php.net/bug.php?id=43073

See http://www.yessum.org/gdbug2/ for font and samples. This bug appears
to be in 5.1.6, and has since gotten worse in the latest svn. 

Also, in 5.3.3-dev, the text doesn't seem to even be on the same baseline
on many of the angles.

Reproduce code:
---
?php
$font = './cour.ttf'; // Courier New

$im = imagecreatetruecolor(600, 600);

imagefill($im, 0, 0, imagecolorallocate($im, 224, 224, 224));
$black = imagecolorallocate($im, 0, 0, 0);
$red = imagecolorallocate($im, 255, 0, 0);

$angle = 0;
do {
$bbox = imagettftext($im, 16, $angle, 299, 299, $black, $font,
'The quick brown fox');
imagepolygon($im, $bbox, 4, $red);
$angle += 45;
} while ($angle  360);

header('content-type: image/png');
imagepng($im);

Expected result:

The bounding box should be a bounding box

Actual result:
--
The string is not contained in the bounding box.

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



#50958 [NEW]: imagettftext() Kerning errors

2010-02-07 Thread sks76543210 at gmail dot com
From: sks76543210 at gmail dot com
Operating system: CentOS 5
PHP version:  5.3SVN-2010-02-07 (snap)
PHP Bug Type: GD related
Bug description:  imagettftext() Kerning errors

Description:

Text created with imagettftext() has kerning (letter-spacing) errors

Reproduce code:
---
Please see http://www.yessum.org/gdbug/ for example images, fonts used,
and sample php script. Entire test case is tar'ed at
http://www.yessum.org/gdbug.tar.gz

In PHP 5.1.6, with GD version bundled (2.0.28 compatible), the test
images did not have any kerning errors.

In the php5.3-201002071530 snapshot with GD version bundled (2.0.34
compatible), the text on the images is not displayed properly, especially
evident in
http://www.yessum.org/gdbug/scriptina-php-5.3.3-dev-gd-2.0.34.png but there
are less noticeable errors in
http://www.yessum.org/gdbug/times-new-roman-php-5.3.3-dev-gd-2.0.34.png as
well.

Expected result:

imagettftext() should continue displaying text as it did in PHP 5.1.6 with
GD 2.0.28

Actual result:
--
imagettftext() has kerning errors making the text completely illegible in
some cases

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



#50958 [Opn]: imagettftext() Kerning errors

2010-02-07 Thread sks76543210 at gmail dot com
 ID:   50958
 User updated by:  sks76543210 at gmail dot com
 Reported By:  sks76543210 at gmail dot com
 Status:   Open
 Bug Type: GD related
 Operating System: CentOS 5
 PHP Version:  5.3SVN-2010-02-07 (snap)
 New Comment:

To summarize:
These are correct
http://www.yessum.org/gdbug/scriptina-php-5.1.6-gd-2.0.28.png
http://www.yessum.org/gdbug/times-new-roman-php-5.1.6-gd-2.0.28.png

These are incorrect
http://www.yessum.org/gdbug/scriptina-php-5.3.3-dev-gd-2.0.34.png
http://www.yessum.org/gdbug/times-new-roman-php-5.3.3-dev-gd-2.0.34.png


Previous Comments:


[2010-02-07 23:42:56] sks76543210 at gmail dot com

Description:

Text created with imagettftext() has kerning (letter-spacing) errors

Reproduce code:
---
Please see http://www.yessum.org/gdbug/ for example images, fonts used,
and sample php script. Entire test case is tar'ed at
http://www.yessum.org/gdbug.tar.gz

In PHP 5.1.6, with GD version bundled (2.0.28 compatible), the test
images did not have any kerning errors.

In the php5.3-201002071530 snapshot with GD version bundled (2.0.34
compatible), the text on the images is not displayed properly,
especially evident in
http://www.yessum.org/gdbug/scriptina-php-5.3.3-dev-gd-2.0.34.png but
there are less noticeable errors in
http://www.yessum.org/gdbug/times-new-roman-php-5.3.3-dev-gd-2.0.34.png
as well.

Expected result:

imagettftext() should continue displaying text as it did in PHP 5.1.6
with GD 2.0.28

Actual result:
--
imagettftext() has kerning errors making the text completely illegible
in some cases





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



#50958 [Opn]: imagettftext() Kerning errors

2010-02-07 Thread sks76543210 at gmail dot com
 ID:   50958
 User updated by:  sks76543210 at gmail dot com
 Reported By:  sks76543210 at gmail dot com
 Status:   Open
 Bug Type: GD related
 Operating System: CentOS 5
 PHP Version:  5.3SVN-2010-02-07 (snap)
 New Comment:

My Apologies, this may be a duplicate of
http://bugs.php.net/bug.php?id=50194


Previous Comments:


[2010-02-07 23:45:32] sks76543210 at gmail dot com

To summarize:
These are correct
http://www.yessum.org/gdbug/scriptina-php-5.1.6-gd-2.0.28.png
http://www.yessum.org/gdbug/times-new-roman-php-5.1.6-gd-2.0.28.png

These are incorrect
http://www.yessum.org/gdbug/scriptina-php-5.3.3-dev-gd-2.0.34.png
http://www.yessum.org/gdbug/times-new-roman-php-5.3.3-dev-gd-2.0.34.png



[2010-02-07 23:42:56] sks76543210 at gmail dot com

Description:

Text created with imagettftext() has kerning (letter-spacing) errors

Reproduce code:
---
Please see http://www.yessum.org/gdbug/ for example images, fonts used,
and sample php script. Entire test case is tar'ed at
http://www.yessum.org/gdbug.tar.gz

In PHP 5.1.6, with GD version bundled (2.0.28 compatible), the test
images did not have any kerning errors.

In the php5.3-201002071530 snapshot with GD version bundled (2.0.34
compatible), the text on the images is not displayed properly,
especially evident in
http://www.yessum.org/gdbug/scriptina-php-5.3.3-dev-gd-2.0.34.png but
there are less noticeable errors in
http://www.yessum.org/gdbug/times-new-roman-php-5.3.3-dev-gd-2.0.34.png
as well.

Expected result:

imagettftext() should continue displaying text as it did in PHP 5.1.6
with GD 2.0.28

Actual result:
--
imagettftext() has kerning errors making the text completely illegible
in some cases





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