php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #73582 Failing ext/gd/tests/imagettftext_charmap_order.phpt
Submitted: 2016-11-22 16:22 UTC Modified: 2016-11-25 21:53 UTC
From: ab@php.net Assigned: cmb (profile)
Status: Closed Package: Testing related
PHP Version: Irrelevant OS: FreeBSD, Linux
Private report: No CVE-ID: None
 [2016-11-22 16:22 UTC] ab@php.net
Description:
------------
The subject test fails, here are the relevant configure options

--with-gd
--with-png-dir=/usr/local
--enable-gd-native-ttf
--with-freetype-dir=/usr/local
--with-webp-dir=/usr/local
--with-jpeg-dir=/usr/local

I'm pretty sure, it's reproduceable elsewhere as well. Just had no time to switch to Linux for a test, but it's also confirmed by Dmitry to fail there. Probably for Linux the paths would be /usr instead of /usr/local.

On Windows, this test is currently not run, so not sure there's an issue there, too.


Test script:
---------------
The test ext/gd/tests/imagettftext_charmap_order.phpt

Expected result:
----------------
Test passes.

Actual result:
--------------
001+ FAIL 0 black pixels
001- SUCCESS %d black pixels

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-11-22 16:25 UTC] ab@php.net
-Assigned To: +Assigned To: cmb
 [2016-11-22 16:25 UTC] ab@php.net
Christoph, could you please take a look?

Thanks.
 [2016-11-22 17:02 UTC] cmb@php.net
I can't reproduce the test failure (and the test never failed for
me in the past), but I presume that that depends on the freetype
version and its configuration. Please store the created image as
PNG; something like:

  imagepng($im, __DIR__ . DIRECTORY_SEPARATOR .
  'imagettftext_charmap_order.png');

Then please make the image available somewhere.
 [2016-11-22 17:19 UTC] ab@php.net
Here you are http://picpaste.de/pics/bug73582.1479834942.png . Freetype 2.5.2, unfortunately I can't tell much about its configuration, as it's a precompiled package from the distro.

Thanks.
 [2016-11-22 18:39 UTC] ab@php.net
An update on this - i've got another vm with freetype 2.6.3 by default, and the test passes there. Seems to be indeed a version behavior difference.

Thanks.
 [2016-11-22 23:18 UTC] cmb@php.net
Thanks for the image and the info that the test succeeds in the
other environment. I'll try to reproduce with FT 2.5.2 or FreeBSD,
so that I can debug.
 [2016-11-23 17:11 UTC] cmb@php.net
-Status: Assigned +Status: Open -Assigned To: cmb +Assigned To:
 [2016-11-23 17:11 UTC] cmb@php.net
I've still not been able to reproduce the failing test. I've tried
on Debian 8.4 with the default freetype2 package (2.5.2) and a
self-compiled freetype-2.5.2 one, and on FreeBSD 10.3 with the
default freetype2 package(2.6.3) and with the
freetype2-2.5.0.1.txz and freetype2-2.5.3_2.txz package. The test
always passes here.

> Freetype 2.5.2, unfortunately I can't tell much about its
> configuration, as it's a precompiled package from the distro.

I have not been able to find a FreeBSD freetype-2.5.2 package. :/

I'm afraid, I can't help here.
 [2016-11-24 10:28 UTC] ab@php.net
If it helps, i've reproduced the fail on Jessie as well, with the shipped freetype 2.5.2. I couldn't work on this in short term as well :/

Thanks.
 [2016-11-24 12:12 UTC] cmb@php.net
-Status: Open +Status: Verified -Assigned To: +Assigned To: cmb
 [2016-11-24 12:12 UTC] cmb@php.net
Well, I tried again, and I can reproduce if I configure with
`--enable-gd-jis-conv`. Not sure, if that's the problem you've
found, but at least this has to be fixed. I'll look into it.
 [2016-11-24 12:39 UTC] ab@php.net
Thanks for looking into this again :) I obviously lost --enable-gd-jis-conv in the description, but it is indeed present in my config. Though, causing the test to fail only in certain env. Looks like there was always some bug, as the test is present for longer already, despite it doesn't fail with newer freetype.

Thanks.
 [2016-11-24 14:42 UTC] cmb@php.net
Thanks for the quick confirmation. For me, the test fails even
with freetype 2.6.5 with `--enable-gd-jis-conv`. I wonder what the
image looks like in environments where the test suceeds with
`--enable-gd-jis-conv`. The expected image would be something like
<http://imgur.com/gallery/AETBl>.

There may indeed be issues with `--enable-gd-jis-conv`, but there
are definitely general issues with GD's freetype support[1][2],
besides that gdft.c has diverged between external and bundled
libgd, so IMHO, for now it might be best to just skip the test if
PHP has been built with JIS-mapped Japanese Font Support, i.e.
adding the following to the SKIPIF section:

  if(gd_info()['JIS-mapped Japanese Font Support'])
     die('skip JIS-mapped Japanese Font Support not supported');

[1] <https://bugs.php.net/search.php?cmd=display&bug_type=All&status=Open&package_name%5B%5D=GD+related&by=Any&limit=30>
[2] <https://github.com/libgd/libgd/issues?utf8=%E2%9C%93&q=is%3Aissue%20is%3Aopen%20text>
 [2016-11-25 21:53 UTC] cmb@php.net
-Package: GD related +Package: Testing related
 [2016-11-25 22:33 UTC] cmb@php.net
Automatic comment on behalf of cmbecker69@gmx.de
Revision: http://git.php.net/?p=php-src.git;a=commit;h=7f529e3dee032d5977166c3eb7b70f57edc8e562
Log: Fix #73582: Failing ext/gd/tests/imagettftext_charmap_order.phpt
 [2016-11-25 22:33 UTC] cmb@php.net
-Status: Verified +Status: Closed
 [2016-11-30 23:13 UTC] davey@php.net
Automatic comment on behalf of cmbecker69@gmx.de
Revision: http://git.php.net/?p=php-src.git;a=commit;h=7f529e3dee032d5977166c3eb7b70f57edc8e562
Log: Fix #73582: Failing ext/gd/tests/imagettftext_charmap_order.phpt
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Mon Oct 14 21:01:26 2019 UTC