Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Captcha generation fails to find font file for relative path #314

Closed
Sinthorion opened this issue Nov 16, 2020 · 1 comment
Closed

Captcha generation fails to find font file for relative path #314

Sinthorion opened this issue Nov 16, 2020 · 1 comment

Comments

@Sinthorion
Copy link

On my dev server, captcha generation produced the error: imagettfbbox(): Could not find/open font (in image.php line 421). The font path is a valid file (and thus is_file(...) earlier returns true), but some versions of the GD library have special handling for relative font paths:

Depending on which version of the GD library PHP is using, when $fontfile does not begin with a leading / then .ttf will be appended to the filename and the library will attempt to search for that filename along a library-defined font path.

Changing the UI path in the F3 config to an absolute path therefore fixes the problem.

Maybe to account for this, line 413 could be changed to this, which also fixes the problem:

			if (is_file($path=realpath($dir.$font))) {

Here is my phpinfo GD section, in case it helps
grafik

@ikkez ikkez transferred this issue from bcosca/fatfree Dec 13, 2020
ikkez added a commit to ikkez/fatfree-core that referenced this issue Nov 4, 2022
@ikkez
Copy link
Member

ikkez commented Nov 4, 2022

fixed

@ikkez ikkez closed this as completed Nov 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants