From: fdsoft@pganet.com
Operating system: Red Hat Linux 7.3
PHP version: 4.3.0-pre2
PHP Bug Type: GD related
Bug description: imagepstext generates weird images since PHP 4.3.0-pre1
I use the GD extension to generate .png images automatically for displaying
text with a specific Type1 font, using the imagepstext function.
PHP 4.2.x generates these images perfectly, while using PHP 4.3.0-pre1 and
-pre2 results in some really weird output.
Here are some examples to show the difference:
http://web.axelero.hu/fdsoft/temp/images.html
There actually seems to be two seperate problems:
- the characters are not lined up properly any more
- anti-aliasing produces weird output (most pronounced when the resulting
image is viewed in IE 6, less ugly but still noticeable in Mozilla)
The anti-aliasing problem pretty much goes away if I recompile PHP
4.3.0-pre2 to use my old GD 1.8.4 (from the Red Hat rpms) instead of PHP's
built-in version of GD.
The php code in question:
<code>
$fonthandle=@imagepsloadfont(FONT_PATH.$font);
imagepsencodefont($fonthandle, FONT_PATH.'IsoLatin1.enc');
$im = imagecreate($imgwidth, $imgheight);
$background_color = imagecolorallocate ($im, $background[0],
$background[1], $background[2]);
imagecolortransparent($im, $background_color);
$text_color = imagecolorallocate ($im,
$color[0], $color[1], $color[2]);
imagepstext($im, $txt, $fonthandle, $size, $text_color,
$background_color,$x, $y, 0, 0, 0, 16);
imagepng($im);
</code>
Finally my php configure options:
<code>
--host=i686-pc-linux-gnu --build=i686-pc-linux-gnu
--target=i386-redhat-linux-gnu --program-prefix= --prefix=/usr
--exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc
--datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib
--libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/usr/com
--mandir=/usr/share/man --infodir=/usr/share/info --prefix=/usr
--with-config-file-path=/etc --with-exec-dir=/usr/bin
--enable-force-cgi-redirect --disable-debug --enable-dbg=shared
--with-dbg-profiler --enable-pic --disable-rpath
--enable-inline-optimization --with-bz2 --with-db3 --with-curl=/usr/local
--with-freetype-dir=/usr --with-png-dir=/usr --with-gd=shared
--enable-gd-native-ttf --with-ttf --with-t1lib
--with-gettext=shared --with-ncurses --with-iconv=shared
--with-jpeg-dir=/usr --with-openssl --with-png --with-regex=system
--with-expat-dir=/usr --with-zlib --with-layout=GNU --enable-bcmath
--enable-exif --enable-ftp
--enable-sockets --enable-sysvsem --enable-sysvshm --enable-discard-path
--enable-track-vars --enable-trans-sid
--enable-wddx --enable-exif --enable-memory-limit --enable-bcmath
--enable-shmop --enable-versioning --enable-calendar --enable-dbx
--enable-dio --enable-mcal --with-readline --with-mysql=shared,/usr
--with-sybase-ct=shared,/usr/local --with-pgsql=shared
--with-unixODBC=shared --with-interbase=shared,/opt/interbase
--with-imap=shared --with-imap-ssl --with-kerberos=/usr/kerberos
--with-zip=shared --with-pspell=shared --with-ming=shared
--with-pdflib=shared --with-pear=/usr/share/pear
--with-apxs=/usr/sbin/apxs
</code>
The '--with-gd=shared' option was changed to '--with-gd=shared,/usr' to
produce the "without built-in GD" output.
--
Edit bug report at http://bugs.php.net/?id=20451&edit=1
--
Try a CVS snapshot: http://bugs.php.net/fix.php?id=20451&r=trysnapshot
Fixed in CVS: http://bugs.php.net/fix.php?id=20451&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=20451&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=20451&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=20451&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=20451&r=support
Expected behavior: http://bugs.php.net/fix.php?id=20451&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=20451&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=20451&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=20451&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=20451&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=20451&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=20451&r=isapi