From: v1d4l0k4 at gmail dot com
Operating system: Windows XP SP2
PHP version: 5.2.1
PHP Bug Type: GD related
Bug description: imagepstext() and imagepsbbox() doesn't have optional
parameters
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()
--
Edit bug report at http://bugs.php.net/?id=40428&edit=1
--
Try a CVS snapshot (PHP 4.4):
http://bugs.php.net/fix.php?id=40428&r=trysnapshot44
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=40428&r=trysnapshot52
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=40428&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=40428&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=40428&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=40428&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=40428&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=40428&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=40428&r=support
Expected behavior: http://bugs.php.net/fix.php?id=40428&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=40428&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=40428&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=40428&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=40428&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=40428&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=40428&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=40428&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=40428&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=40428&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=40428&r=mysqlcfg