Bug #51263 [Opn-Csd]: imagettftext and rotated text uses wrong baseline (regression)

2010-03-25 Thread tabe
Edit report at http://bugs.php.net/bug.php?id=51263edit=1

 ID:  51263
 Updated by:  t...@php.net
 Reported by: cschneid at cschneid dot com
 Summary: imagettftext and rotated text uses wrong baseline
  (regression)
-Status:  Open
+Status:  Closed
 Type:Bug
 Package: GD related
 PHP Version: 5.3.2
-Assigned To: 
+Assigned To: tabe

 New Comment:

Hi cschneid,



Thanks for your patch. Applied.


Previous Comments:

[2010-03-24 05:12:21] t...@php.net

Automatic comment from SVN on behalf of tabe
Revision: http://svn.php.net/viewvc/?view=revisionamp;revision=296693
Log: Fixed bug #51263 (imagettftext and rotated text uses wrong
baseline)


[2010-03-10 15:56:25] cschneid at cschneid dot com

Description:

imagettftext and rotated text by e.g. 90 degrees aligns text on top of
characters instead of baseline.



The regression was introduced with commit

r293268  | tabe   | 2010-01-08 13:18:52 | Bug #49600 (imageTTFText
text shifted right) - fix difference of horizontal position between
imagettftext() and imagettfbbox()



Test script:
---
?php

$img = imagecreatetruecolor(23, 100);

$col = imagecolorallocate($img, 255, 255, 255);

imagettftext($img, 8, 90,  10, 90, $col, verdana.ttf, foo bar qux);

imagepng($img, img.png);



Expected result:

Normal text rotated by 90 degrees

Actual result:
--
Text rotated but aligned at top of characters instead of bottom






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


Bug #51352 [Opn-Dup]: imagettftext left-aligns text inappropriately

2010-03-23 Thread tabe
Edit report at http://bugs.php.net/bug.php?id=51352edit=1

 ID:   51352
 Updated by:   t...@php.net
 Reported by:  gregor at hostgis dot com
 Summary:  imagettftext left-aligns text inappropriately
-Status:   Open
+Status:   Duplicate
 Type: Bug
 Package:  GD related
 Operating System: Linux, Slamd64 11.0
 PHP Version:  5.2.13
-Assigned To:  
+Assigned To:  tabe

 New Comment:

Thanks for your report.

Reproduced, and this bug seems a duplicate of #51263.


Previous Comments:

[2010-03-22 18:51:39] gregor at hostgis dot com

Description:

When rotating text, imagettftext() aligns all of the letters and
characters

to be flush with the left-hand side of their box. Under many rotation

conditions and particularly with punctuation that is not bottom-aligned

(apostrophes, dashes) this is very unpleasant.



The test script below demonstrates this very well.



This appears similar to bug # 51263 but is in PHP 5.2.13

Test script:
---
$image = imagecreatetruecolor(200,200);

$white = imagecolorallocate($image,255,255,255);

$black = imagecolorallocate($image,0,0,0);

$font =
'/home/customers/tnassoc/public_html/php-library/fonts/arial.ttf';

imagefill($image, 0, 0, $white);



imagettftext($image, 10, -90,  50, 80, $black, $font, Clock-Un'Wise
);

imagettftext($image, 10, 90, 150, 100, $black, $font, 
Counter-O'Clock

);

imagettftext($image, 10,   0,  20, 20, $black, $font, Normal-Text );



header('Content-type: image/png');

imagepng($image);



Expected result:

Three sets of words:



0. Normal-Text should appear normal left-to-right.



1. Clock-Un'Wise should be rotated 90 degrees right, and otherwise be

normal and readable.



2. Counter-O'Clock should be rotated 90 degrees left, and otherwise be

normal and readable.



Actual result:
--
0. Unrotated text is fine.



1. All characters are shifted to the left, aligned to the bottom of the

text. This includes the apostrophe and dash, with very unpleasant
results.



2. All characters are shifted to the left, aligned to the top of the
text.

The dash is now at the top of the text instead of the middle, and the

letters don't line up anymore.








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


#49869 [Asn-Fbk]: imagettfbbox returns bogus value

2010-01-18 Thread tabe
 ID:   49869
 Updated by:   t...@php.net
 Reported By:  orel at melix dot net
-Status:   Assigned
+Status:   Feedback
 Bug Type: GD related
 Operating System: Linux
 PHP Version:  5.2.11
 Assigned To:  tabe
 New Comment:

Please try using this snapshot:

  http://snaps.php.net/php5.3-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/




Previous Comments:


[2009-11-04 15:05:50] orel at melix dot net

It is ok with PHP 5.3.2-dev
with this configure line
./configure  --with-gd --enable-gd-native-ttf  --with-freetype-dir

Result is
Array
(
[0] = -1
[1] = 3
[2] = 173
[3] = 3
[4] = 173
[5] = -14
[6] = -1
[7] = -14
)



[2009-10-29 03:30:31] t...@php.net

Please try using this snapshot:

  http://snaps.php.net/php5.3-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/

It looks ok with PHP_5_3:
Array
(
[0] = -1
[1] = 3
[2] = 173
[3] = 3
[4] = 173
[5] = -14
[6] = -1
[7] = -14
)




[2009-10-13 18:56:23] paj...@php.net

Hm that one is new, time to look at it Tabe?



[2009-10-13 18:41:08] orel at melix dot net

Description:

imagettfbbox returns bogus values:
Array
(
[0] = 0
[1] = 3
[2] = -2147483648
[3] = 3
[4] = -2147483648
[5] = -14
[6] = 0
[7] = -14
)

5.2.0-8+etch13 is ok
5.2.11-1 is ko

Reproduce code:
---
print_r(imagettfbbox(12, 0,/home/somewhere/verdanab.ttf, Recipient
responses));


Expected result:

Array
(
[0] = 0
[1] = 3
[2] = 181
[3] = 3
[4] = 181
[5] = -14
[6] = 0
[7] = -14
)


Actual result:
--
Array
(
[0] = 0
[1] = 3
[2] = -2147483648
[3] = 3
[4] = -2147483648
[5] = -14
[6] = 0
[7] = -14
)






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



#49815 [Asn-Fbk]: Problem with imagettfbbox

2010-01-13 Thread tabe
 ID:   49815
 Updated by:   t...@php.net
 Reported By:  christian dot roy at orange dot fr
-Status:   Assigned
+Status:   Feedback
 Bug Type: GD related
 Operating System: Linux
 PHP Version:  5.2.11
 Assigned To:  tabe
 New Comment:

rasmus, your observation is essential to understand this bug.
fix for bug#45600 also seems to work well.

With PHP_5_2 or trunk:

bbox returned rectangle for a : -1  *  2  *  38  *  2  *  38  *  -42  *
 -1  *  -42

bbox returned rectangle for k : -1  *  -1  *  42  *  -1  *  42  *  -62 
*  -1  *  -62

bbox returned rectangle for j : -1  *  17  *  23  *  17  *  23  *  -57 
*  -1  *  -57


Previous Comments:


[2009-12-23 17:49:24] christian dot roy at orange dot fr

Hi,

Did you progress on this issue whicj sticks me to PHP 4.

Thanks for your answer.



[2009-12-16 21:56:23] rasmus at mindplay dot dk

To help you debug this issue, I created the following test-script:

?php

define('SAMPLE', @$_SERVER['QUERY_STRING'] ? $_SERVER['QUERY_STRING'] :
'abc');
define('SAMPLE_TTF', dirname(__FILE__).'/georgiai.ttf');
define('SAMPLE_SIZE', 100);
define('SAMPLE_PAD', 50);

$m = imagettfbbox(SAMPLE_SIZE, 0, SAMPLE_TTF, SAMPLE);

$width = $m[4]-$m[6] + 2*SAMPLE_PAD;
$height = $m[1]-$m[7] + 2*SAMPLE_PAD;

$baseline = abs($m[7]);

$img = imagecreatetruecolor($width,$height);
$red = imagecolorallocate($img,255,0,0);
$white = imagecolorallocate($img,255,255,255);

imagettftext(
  $img,
  SAMPLE_SIZE, # size
  0,   # angle
  SAMPLE_PAD,  # x
  SAMPLE_PAD+$baseline,  # y
  $white,
  SAMPLE_TTF,
  SAMPLE
);

imagerectangle(
  $img,
  $m[6]+SAMPLE_PAD, $m[7]+SAMPLE_PAD+$baseline, # upper left x,y
  $m[2]+SAMPLE_PAD, $m[3]+SAMPLE_PAD+$baseline, # lower right x,y
  $red
);

header('Content-type: image/png');
imagepng($img);

?

You will need to adjust the SAMPLE_TTF path to point to a valid
truetype file - the one I'm using is Windows standard Georgia Italics.

The output should be a white sample of text with a red border, and the
border should grace the text, not overlap it.

For reference, here's what it looks like on Linux (GOOD):

http://mindplay.dk/temp/metrics/imagettf-good.png

And here's what it looks like on Windows (BAD):

http://mindplay.dk/temp/metrics/imagettf-bad.png

I just tried the latest XAMPP build (1.7.2 beta 2) for Windows, and the
bug is still present.

If you run the script from a browser, you can add your own sample text
by adding a query string, e.g.:

http://localhost/sample.php?abcdefg

Note that using a larger font-size (SAMPLE_SIZE) seems to increase the
error. It seems that all the returned coordinates are off by a
percentage, not by a fixed number of pixels.

I hope this helps solve the problem...



[2009-12-08 13:57:04] rasmus at mindplay dot dk

This problem occurs with imageftbbox() as well.

I developed a font-embedding system (http://fontjazz.com) and it has 
worked for a long time with PHP5.1 and earlier, but never with PHP 5.2

or 5.3, where the coordinates (both X and Y) come out all wrong.

I'm using Windows for development, Linux for deployment, and I have to

keep the production server running with PHP 5.1 for this reason - both

Linux and Windows versions fail to give the right coordinates.



[2009-10-08 20:19:09] paj...@php.net

Tabe, can you look at this one too please? :)



[2009-10-08 20:14:30] christian dot roy at orange dot fr

Sorry. 

Actual result should have been :

with 5.2.11 :

bbox returned rectangle for a : -1  *  1  *  32  *  1  *  32  *  -38  *
 -1  *  -38

bbox returned rectangle for k : -1  *  -1  *  37  *  -1  *  37  *  -57 
*  -1  *  -57

bbox returned rectangle for j : -1  *  17  *  21  *  17  *  21  *  -57 
*  -1  *  -57



The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/49815

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



#49815 [Fbk]: Problem with imagettfbbox

2010-01-13 Thread tabe
 ID:   49815
 Updated by:   t...@php.net
 Reported By:  christian dot roy at orange dot fr
 Status:   Feedback
 Bug Type: GD related
 Operating System: Linux
 PHP Version:  5.2.11
 Assigned To:  tabe
 New Comment:

s/#45600/#49600/


Previous Comments:


[2010-01-14 04:59:07] t...@php.net

rasmus, your observation is essential to understand this bug.
fix for bug#45600 also seems to work well.

With PHP_5_2 or trunk:

bbox returned rectangle for a : -1  *  2  *  38  *  2  *  38  *  -42  *
 -1  *  -42

bbox returned rectangle for k : -1  *  -1  *  42  *  -1  *  42  *  -62 
*  -1  *  -62

bbox returned rectangle for j : -1  *  17  *  23  *  17  *  23  *  -57 
*  -1  *  -57



[2009-12-23 17:49:24] christian dot roy at orange dot fr

Hi,

Did you progress on this issue whicj sticks me to PHP 4.

Thanks for your answer.



[2009-12-16 21:56:23] rasmus at mindplay dot dk

To help you debug this issue, I created the following test-script:

?php

define('SAMPLE', @$_SERVER['QUERY_STRING'] ? $_SERVER['QUERY_STRING'] :
'abc');
define('SAMPLE_TTF', dirname(__FILE__).'/georgiai.ttf');
define('SAMPLE_SIZE', 100);
define('SAMPLE_PAD', 50);

$m = imagettfbbox(SAMPLE_SIZE, 0, SAMPLE_TTF, SAMPLE);

$width = $m[4]-$m[6] + 2*SAMPLE_PAD;
$height = $m[1]-$m[7] + 2*SAMPLE_PAD;

$baseline = abs($m[7]);

$img = imagecreatetruecolor($width,$height);
$red = imagecolorallocate($img,255,0,0);
$white = imagecolorallocate($img,255,255,255);

imagettftext(
  $img,
  SAMPLE_SIZE, # size
  0,   # angle
  SAMPLE_PAD,  # x
  SAMPLE_PAD+$baseline,  # y
  $white,
  SAMPLE_TTF,
  SAMPLE
);

imagerectangle(
  $img,
  $m[6]+SAMPLE_PAD, $m[7]+SAMPLE_PAD+$baseline, # upper left x,y
  $m[2]+SAMPLE_PAD, $m[3]+SAMPLE_PAD+$baseline, # lower right x,y
  $red
);

header('Content-type: image/png');
imagepng($img);

?

You will need to adjust the SAMPLE_TTF path to point to a valid
truetype file - the one I'm using is Windows standard Georgia Italics.

The output should be a white sample of text with a red border, and the
border should grace the text, not overlap it.

For reference, here's what it looks like on Linux (GOOD):

http://mindplay.dk/temp/metrics/imagettf-good.png

And here's what it looks like on Windows (BAD):

http://mindplay.dk/temp/metrics/imagettf-bad.png

I just tried the latest XAMPP build (1.7.2 beta 2) for Windows, and the
bug is still present.

If you run the script from a browser, you can add your own sample text
by adding a query string, e.g.:

http://localhost/sample.php?abcdefg

Note that using a larger font-size (SAMPLE_SIZE) seems to increase the
error. It seems that all the returned coordinates are off by a
percentage, not by a fixed number of pixels.

I hope this helps solve the problem...



[2009-12-08 13:57:04] rasmus at mindplay dot dk

This problem occurs with imageftbbox() as well.

I developed a font-embedding system (http://fontjazz.com) and it has 
worked for a long time with PHP5.1 and earlier, but never with PHP 5.2

or 5.3, where the coordinates (both X and Y) come out all wrong.

I'm using Windows for development, Linux for deployment, and I have to

keep the production server running with PHP 5.1 for this reason - both

Linux and Windows versions fail to give the right coordinates.



[2009-10-08 20:19:09] paj...@php.net

Tabe, can you look at this one too please? :)



The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/49815

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



#49600 [Asn-Fbk]: imageTTFText text shifted right

2010-01-11 Thread tabe
 ID:   49600
 Updated by:   t...@php.net
 Reported By:  ch+php at -internet dot com
-Status:   Assigned
+Status:   Feedback
 Bug Type: GD related
 Operating System: FreeBSD 7.0
 PHP Version:  5.2.11
 Assigned To:  tabe
 New Comment:

Please try using this snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/




Previous Comments:


[2010-01-08 12:18:53] s...@php.net

Automatic comment from SVN on behalf of tabe
Revision: http://svn.php.net/viewvc/?view=revisionrevision=293268
Log: Bug #49600 (imageTTFText text shifted right)
- fix difference of horizontal position between imagettftext() and
imagettfbbox()



[2009-09-25 05:00:53] ch+php at -internet dot com

Just noticed that the text positioning between the two examples is
exactly the same - it's the bounding coordinates that changed. This
suggests that in =5.2.9 BOTH the text and the boxes were shifted right
(which was less noticeable in practice since they were in sync - but a
closer inspection of the 5.2.9 example does show this). The bounding
coordinates are now where one would expect them to be, but that's not
where the text is.



[2009-09-19 17:49:44] paj...@php.net

Tabe, can you take a look at this bug please? The only change in this
area was the latest patch about bbox.



[2009-09-19 17:34:59] ch+php at -internet dot com

Here's the correct result produced by the same code example with
5.2.9:

http://www.-internet.com/images/php5_2_9_gdft_hpos.png



[2009-09-19 15:47:15] ch+php at -internet dot com

Description:

imageTTFText appears to have an issue with horizontal positioning of
characters. This was introduced with 5.2.10 (which also had a vertical
positioning issue cited in Bug #48801) and continues with 5.2.11 (where
the vertical issue appears to have been corrected).

Nothing special in my config, but here it is just in case:

'./configure' '--prefix=/usr/local/php5'
'--with-apxs2=/usr/local/apache2/bin/apxs' '--enable-track-vars'
'--with-mysql=/usr/local/mysql' '--with-gd' '--with-zlib-dir=/usr/local'
'--enable-zip' '--with-freetype-dir=/usr/local'
'--with-jpeg-dir=/usr/local' '--with-png-dir=/usr/local'
'--with-tiff-dir=/usr/local' '--with-mcrypt=/usr/local'
'--with-pdflib=/usr/local' '--with-curl=/usr/local' '--enable-ftp'
'--without-iconv' '--without-pear'


Reproduce code:
---
$image=imagecreatetruecolor(401, 51);
imagefill($image, 0, 0, imagecolorallocate($image, 255, 255, 255));
list($fontcolor, $outlinecolor,
$gridcolor)=array(imagecolorallocate($image, 0, 0, 0),
imagecolorallocatealpha($image, 255, 0, 0, 64),
imagecolorallocate($image, 222, 255, 255));

for ($x=0; $x=imagesx($image)-1; $x+=5) {imageline($image, $x, 0, $x,
imagesy($image)-1, $gridcolor);}
for ($y=0; $y=imagesy($image)-1; $y+=5) {imageline($image, 0, $y,
imagesx($image)-1, $y, $gridcolor);}

foreach (array(array(face=arial, text=E),
array(face=arial, text=I), array(face=arial,
text=P), array(face=arial, text=g),
array(face=arial, text=i), array(face=arial,
text=q), array(face=wingdng2, text=#61630;),
array(face=webdings, text=#61476;)) as $index=$array)
{
list($xl, $yb, $xr, $yb2, $xr2, $yt)=imagettftext($image, 32, 0,
10+$index*50, 36, $fontcolor, /www/fonts/. $array[face]. .ttf,
$array[text]);
imagerectangle($image, $xl, $yt, $xr, $yb, $outlinecolor);
}

header(Content-Type: image/png);
imagepng($image);
imagedestroy($image);
exit;


Expected result:

characters should fit neatly inside the rectangle outlines drawn using
the return values from imagettftext, and should left align to the $x
parameter of imagettftext


Actual result:
--
http://www.-internet.com/images/php5_2_11_gdft_hpos.png

outline rectangles appear to be correct sizes and positions, but
characters are often shifted right






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



#50014 [Asn-Fbk]: imagettfbbox gives unexpected results.

2009-10-29 Thread tabe
 ID:   50014
 Updated by:   t...@php.net
 Reported By:  info at frankdegraaf dot net
-Status:   Assigned
+Status:   Feedback
 Bug Type: GD related
 Operating System: Debian Lenny amd64
 PHP Version:  5.2.11
 Assigned To:  pajoye
 New Comment:

Please try using this snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/

It looks ok with PHP_5_2:
Array
(
[0] = -1
[1] = -1
[2] = 26
[3] = -6
[4] = 19
[5] = -45
[6] = -10
[7] = -40
)



Previous Comments:


[2009-10-27 11:51:49] johan...@php.net

Pierre, please check this. Thanks.



[2009-10-27 10:32:19] info at frankdegraaf dot net

Description:

The return results for imagettfbbox are way off. The function gives a
large negative values for [1] (lower left corner, Y position), [2]
(lower right corner, X position), [4](upper right corner, X position),
[7](upper left corner, Y position).

The changelog shows a solved bug regarding this function (#48555),
perhaps it is related.

The font can be downloaded here:
http://www.fonts4free.net/dsplus/m.php?p=bn_machine.zip

Reproduce code:
---
?php
print_r(imagettfbbox(37, 11, '/var/www/fonts/BNMachine.ttf', 'T'));
?

Expected result:

Result from PHP 5.2.10:

Array
(
[0] = -1
[1] = 0
[2] = 25
[3] = -4
[4] = 18
[5] = -42
[6] = -9
[7] = -37
)

Actual result:
--
Result from PHP 5.2.11:

Array
(
[0] = -1
[1] = -2147483648
[2] = -2147483648
[3] = -4
[4] = -2147483648
[5] = -42
[6] = -9
[7] = -2147483648
)





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



#49869 [Asn-Fbk]: imagettfbbox returns bogus value

2009-10-28 Thread tabe
 ID:   49869
 Updated by:   t...@php.net
 Reported By:  orel at melix dot net
-Status:   Assigned
+Status:   Feedback
 Bug Type: GD related
 Operating System: Linux
 PHP Version:  5.2.11
 Assigned To:  tabe
 New Comment:

Please try using this snapshot:

  http://snaps.php.net/php5.3-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/

It looks ok with PHP_5_3:
Array
(
[0] = -1
[1] = 3
[2] = 173
[3] = 3
[4] = 173
[5] = -14
[6] = -1
[7] = -14
)



Previous Comments:


[2009-10-13 18:56:23] paj...@php.net

Hm that one is new, time to look at it Tabe?



[2009-10-13 18:41:08] orel at melix dot net

Description:

imagettfbbox returns bogus values:
Array
(
[0] = 0
[1] = 3
[2] = -2147483648
[3] = 3
[4] = -2147483648
[5] = -14
[6] = 0
[7] = -14
)

5.2.0-8+etch13 is ok
5.2.11-1 is ko

Reproduce code:
---
print_r(imagettfbbox(12, 0,/home/somewhere/verdanab.ttf, Recipient
responses));


Expected result:

Array
(
[0] = 0
[1] = 3
[2] = 181
[3] = 3
[4] = 181
[5] = -14
[6] = 0
[7] = -14
)


Actual result:
--
Array
(
[0] = 0
[1] = 3
[2] = -2147483648
[3] = 3
[4] = -2147483648
[5] = -14
[6] = 0
[7] = -14
)






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



#48732 [Asn-Csd]: TTF Bounding box wrong for letters below baseline

2009-07-27 Thread tabe
 ID:   48732
 Updated by:   t...@php.net
 Reported By:  sta at netimage dot dk
-Status:   Assigned
+Status:   Closed
 Bug Type: GD related
 Operating System: FreeBSD 7.1
 PHP Version:  5.2.10
 Assigned To:  tabe
 New Comment:

This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.




Previous Comments:


[2009-07-27 15:11:46] s...@php.net

Automatic comment from SVN on behalf of tabe
Revision: http://svn.php.net/viewvc/?view=revisionrevision=286417
Log: MFH: fixed #48732 (TTF Bounding box wrong for letters below
baseline) and #48801 (Problem with imagettfbbox)



[2009-07-27 15:06:29] s...@php.net

Automatic comment from SVN on behalf of tabe
Revision: http://svn.php.net/viewvc/?view=revisionrevision=286416
Log: MFH: fixed #48732 (TTF Bounding box wrong for letters below
baseline) and #48801 (Problem with imagettfbbox)



[2009-07-27 15:02:16] s...@php.net

Automatic comment from SVN on behalf of tabe
Revision: http://svn.php.net/viewvc/?view=revisionrevision=286415
Log: fixed #48732 (TTF Bounding box wrong for letters below baseline)
and #48801 (Problem with imagettfbbox)



[2009-07-03 23:34:39] paj...@php.net

Tabe, do you have the time to look at it please?



[2009-07-03 22:42:13] lbayuk at pobox dot com

Duplicated in PHP-5.2.10 and also PHP-5.3.0. The descenders are being
excluded from the bounding box, at all angles. (Sigh. I was the one who
opened bug #43073 for rotated bounding boxes. My mistake for not
including characters with descenders in the original reproduce code.)



The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/48732

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



#48801 [Opn-Csd]: Problem with imagettfbbox

2009-07-27 Thread tabe
 ID:   48801
 Updated by:   t...@php.net
 Reported By:  dgdd at wanadoo dot fr
-Status:   Open
+Status:   Closed
 Bug Type: GD related
 Operating System: Windows XP
 PHP Version:  5.3.0
 New Comment:

This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.




Previous Comments:


[2009-07-27 15:11:47] s...@php.net

Automatic comment from SVN on behalf of tabe
Revision: http://svn.php.net/viewvc/?view=revisionrevision=286417
Log: MFH: fixed #48732 (TTF Bounding box wrong for letters below
baseline) and #48801 (Problem with imagettfbbox)



[2009-07-27 15:06:29] s...@php.net

Automatic comment from SVN on behalf of tabe
Revision: http://svn.php.net/viewvc/?view=revisionrevision=286416
Log: MFH: fixed #48732 (TTF Bounding box wrong for letters below
baseline) and #48801 (Problem with imagettfbbox)



[2009-07-27 15:02:16] s...@php.net

Automatic comment from SVN on behalf of tabe
Revision: http://svn.php.net/viewvc/?view=revisionrevision=286415
Log: fixed #48732 (TTF Bounding box wrong for letters below baseline)
and #48801 (Problem with imagettfbbox)



[2009-07-23 12:22:12] dgdd at wanadoo dot fr

I'm tested width : php 5.2.11 
This snapshot was automatically generated on
Thu, 23 Jul 2009 11:45:25 +0100
Version: 5.2.11-dev
Branch: HEAD
Build: Release_TS


The bug is not fixed

Best regards)



[2009-07-23 11:16:14] john dot peterson3 at hotmail dot com

Thanks for noticing. Please try to fix it if you can. I can't determine
how far above or below the baseline the font is extending now. Could
there be a fix in 5.2.11?


Best Regards
John



The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/48801

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



#48555 [Opn-Csd]: ImageFTBBox() differs from previous versions for texts with new lines

2009-06-21 Thread tabe
 ID:   48555
 Updated by:   t...@php.net
 Reported By:  a dot schilder at gmx dot net
-Status:   Open
+Status:   Closed
 Bug Type: GD related
 Operating System: Windows XP SP3
 PHP Version:  5.3.0RC4
-Assigned To:  
+Assigned To:  tabe
 New Comment:

This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.




Previous Comments:


[2009-06-19 15:20:23] a dot schilder at gmx dot net

This is possibly a side effect of the fix for Bug #43073.



[2009-06-19 12:08:35] a dot schilder at gmx dot net

Version and OS updated



[2009-06-19 12:06:32] a dot schilder at gmx dot net

Find examples for the previous script here...

PHP 5.2.9:
https://www.sendthisfile.com/TsuYvRJwezhz3UCRzlHzIQsm

PHP 5.3.0RC4:
https://www.sendthisfile.com/z8UK5VlTqiUUSKMKQ2lgoplp



[2009-06-19 11:57:45] a dot schilder at gmx dot net

This bug still exists in RC4 and it's critical for me, because with the
wrong value it's no more possible to create valid images (because this
is used for the basline value in ImageFTText()). 

Try this to see it:

?php
$font_file = './arial.ttf';
$text = Text with\nline-break;

// get minimum size
$box = ImageFTBBox(13, 0, $font_file, $text);
$left= 0;
$top = abs($box[7]);
$width   = abs($box[2]) + abs($box[6]);
$height  = abs($box[3]) + abs($box[7]);

// add 1px border
$left++;
$top++;
$width+=2;
$height+=2;

// create image and add text
$img   = ImageCreateTruecolor($width, $height);
$color = imagecolorallocate($img, 233, 14, 91);
ImageFTText($img, 13, 0, $left, $top, $color, $font_file, $text);

// output
header(Content-Type: image/png);
ImagePng($img);
?



[2009-06-15 10:05:09] a dot schilder at gmx dot net

Description:

The results of ImageFTBBox() differs from previous versions for texts
with new lines. 

The image creation works for PHP 5.04 to 5.2.9 (5.2.10 not tested). but
with PHP 5.3RC3 the results are very strange...

Reproduce code:
---
?php
header('Content-Type: text/plain');

$font_file = './arial.ttf';

$box = ImageFTBBox(13, 0, $font_file, Text without line-break);
echo 'Top without line-break: ' . $box[7] . \n;

$box = ImageFTBBox(13, 0, $font_file, Text with\nline-break);
echo 'Top with line-break: ' . $box[7] . \n;
?

Expected result:

Top without line-break: -14
Top with line-break: -14

(result with PHP 5.2.9 and previous versions)

Actual result:
--
Top without line-break: -14
Top with line-break: -36





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



#45799 [Asn-Csd]: imagepng() crashes on empty image

2009-03-14 Thread tabe
 ID:   45799
 Updated by:   t...@php.net
 Reported By:  amelek32 at gmail dot com
-Status:   Assigned
+Status:   Closed
 Bug Type: GD related
 Operating System: *
 PHP Version:  5.2.8, 5.3CVS, 6CVS (2008-12-09)
 Assigned To:  pajoye
 New Comment:

This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.

Thanks for your patch, from which I made a fix in 5.3 and 6CVS.


Previous Comments:


[2009-03-10 11:25:43] mmcnicklebugs at googlemail dot com

[PATCH]

A to see if there are any colors associated with the image before
outputting the image header.

http://whompbox.com/patches/php/libgd.patch



[2008-12-01 11:02:36] paj...@php.net

My bad, you are right!



[2008-12-01 11:00:46] amelek32 at gmail dot com

then

?
$img = imagecreate(500,500);
@imagepng($img);
imagedestroy($img);
?

should return empty page..

However, it do not ;)



[2008-11-30 22:52:48] paj...@php.net

Well, after a 2nd look, the warning will remain anyway. Whether it is
raised by libgd or php does not change anything  won't fix



[2008-08-12 14:25:05] paj...@php.net

 shouldn't it return warning without putting part of header to
output?

Hm, good point. I may add a check before calling the png function and
avoid to much troubles later. I will do it for 5.3+



The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/45799

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