php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #40428 imagepstext() and imagepsbbox() doesn't have optional parameters
Submitted: 2007-02-10 07:42 UTC Modified: 2007-02-11 11:10 UTC
Votes:2
Avg. Score:4.5 ± 0.5
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:2 (100.0%)
From: v1d4l0k4 at gmail dot com Assigned: pajoye (profile)
Status: Closed Package: GD related
PHP Version: 5.2.1 OS: Windows XP SP2
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: v1d4l0k4 at gmail dot com
New email:
PHP Version: OS:

 

 [2007-02-10 07:42 UTC] v1d4l0k4 at gmail dot com
Description:
------------
Manual says:

array imagepstext ( resource $image, string $text, resource $font, int $size, int $foreground, int $background, int $x, int $y [, int $space [, int $tightness [, float $angle [, int $antialias_steps]]]] )

array imagepsbbox ( string $text, int $font, int $size [, int $space [, int $tightness [, float $angle]]] )

But... neither of the optional parameters is accepted.

Reproduce code:
---------------
It's Ok:

<?php

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

$i = imagecreate(468, 60);
$b = imagecolorallocate($i, 0, 0, 0);
$w = imagecolorallocate($i, 255, 255, 255);
$f = imagepsloadfont(realpath('./meta-bold.pfb')); // realpath() is needed because the function requires full path
imagepstext($i, 'Testing... It worked!', $f, 40, $w, $b, 40, 40);
imagepsfreefont($f);
imagepng($i, null, 9, PNG_NO_FILTER);
imagedestroy($i);

?>

It's fail:

<?php

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

$i = imagecreate(468, 60);
$b = imagecolorallocate($i, 0, 0, 0);
$w = imagecolorallocate($i, 255, 255, 255);
$f = imagepsloadfont(realpath('./meta-bold.pfb')); // realpath() is needed because the function requires full path
imagepstext($i, 'Testing... It worked!', $f, 40, $w, $b, 40, 40, 2);
imagepsfreefont($f);
imagepng($i, null, 9, PNG_NO_FILTER);
imagedestroy($i);

?>

Expected result:
----------------
A banner with 2 space-unit of space.

Actual result:
--------------
Warning: Wrong parameter count for imagepstext()

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-02-11 11:10 UTC] pajoye@php.net
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.

I fixed imagepstext, imagepsbbox accepts three or six arguments. All three extra arguments have to be given (is [a,b,c] not [a[,b[,c]]]).

Thanks for your report!
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 15:01:29 2024 UTC