Bug #75656 [Com]: imagettfbbox fails to find my font

From: Date: Fri, 21 Sep 2018 10:21:22 +0000
Subject: Bug #75656 [Com]: imagettfbbox fails to find my font
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-217172@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=75656&edit=1 ID: 75656 Comment by: rolandshin at yahoo dot gr Reported by: momchil at bojinov dot info Summary: imagettfbbox fails to find my font Status: Open Type: Bug Package: GD related Operating System: Windows PHP Version: 7.1.12 Block user comment: N Private report: N New Comment: I also experienced this problem when I changed to PHP 7.2.8 from PHP 5.6. Using a visforms component for joomla. "imagettftext(): Could not find/open font in D:\home\site\wwwroot\components\com_visforms\captcha\securimage.php on line 1211" Modifying secure.php and calling the ttf file with realpath() also solved the problem for me Previous Comments: ------------------------------------------------------------------------ [2018-07-23 14:09:44] Kagome at ese-protect dot de Hello, I expierenced today the same Problem. I wanted to upgrade from PHP 7.1.11 to 7.2.8. After I detected the same Problem as the OP I tested until i found a Version that worked. It was Version 7.1.11 ... Only to make it clear: It is the compiled TS-Version I used from windows.php.net I'm using a Windows Server 2k12R2 and Apache 2.4.33 as Webserver. Is there any timeline when this bug will be fixed? ------------------------------------------------------------------------ [2018-04-03 22:01:40] cmb@php.net > Could one please test a latest snapshot? I just tested with php-7.1-nts-windows-vc14-x64-r37e1d7c and php-7.1-ts-windows-vc14-x64-r37e1d7c (renamed php.ini-development to php.ini; uncommented extension_dir and extension=php_gd2.dll). The imagettfbbox() call fails in both cases. However, the ZTS version warns "Invalid font filename", and the NTS version "Could not find/open font". The ZTS failure is obviously caused by a failing open_basedir check[1] (even though open_basedir is empty); the NTS failure, however, by fontFetch() failing[2] (which is not a libfreetype issue). Using the absolute path (C:/Windows/Fonts/arial.ttf) instead lets the script succeed (both ZTS and NTS). Anyhow, the ZTS failure has already been filed as <https://bugs.php.net/64823>, so we should concentrate on the NTS issue here (even though the OP mentions it happened on TS). [1] <https://github.com/php/php-src/blob/PHP-7.1.16/ext/gd/gd.c#L3917> [2] <https://github.com/php/php-src/blob/PHP-7.1.16/ext/gd/libgd/gdft.c#L454> ------------------------------------------------------------------------ [2018-01-08 12:00:13] ab@php.net I was checking this and 7.1.12 NTS reproduces it with Christoph's code. However the current 7.1 tree doesn't reproduce it - same freetype version. Something must have changed. Could one please test a latest snapshot? Thanks. ------------------------------------------------------------------------ [2018-01-07 18:15:37] cmb@php.net Related To: Bug #75773 ------------------------------------------------------------------------ [2017-12-19 15:49:09] cmb@php.net Well, the most trivial reproduce script: <?php var_dump((bool) imagettfbbox(12, 0, 'arial', 'foo')); This is supposed to print bool(true) but may print bool(false) I have not been able to reproduce bool(false) with a self-built PHP, and debugging with the official php-7.1.12-nts-Win32-VC14-x64 shows erratic behavior, so I'm at a loss. ------------------------------------------------------------------------ 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 https://bugs.php.net/bug.php?id=75656 -- Edit this bug report at https://bugs.php.net/bug.php?id=75656&edit=1

« previous php.bugs (#217172) next »