Issue Bug Resolved

#111190GIFBUILDER TEXT and install tool image tests emit warnings when GD has no FreeType support

Benjamin Kott 10/21/26, 13:20 updated 10/22/26, 15:25

Description

Problem

When PHP’s GD extension is linked against a libgd that was built without FreeType, imagettfbbox() and imagettftext() still exist, but every call fails with:

PHP Warning: imagettfbbox(): libgd was not built with FreeType font support in typo3/sysext/core/Classes/Imaging/GraphicsCanvas.php

Such builds exist, for example PHP compiled to WebAssembly (php-wasm/web), which ships GD without any FreeType symbols. Depending on SYS/exceptionalErrors the warning becomes an exception and the image is not rendered at all. The install tool reports “PHP GD library has freetype font support” in this environment, because it only checks function_exists('imagettftext').

Steps to reproduce

  1. Run TYPO3 on a PHP whose GD reports gd_info()['FreeType Support'] === false while function_exists('imagettftext') is true, e.g. the TYPO3 playground on PHP-WASM.
  2. Render a GIFBUILDER image with a TEXT object, or open the image processing tests in Admin Tools > Environment.
  3. A warning “libgd was not built with FreeType font support” is raised for every text part; the install tool environment check still claims FreeType support.

Cause

GraphicsCanvas::measureText() and GraphicsCanvas::renderText() call imagettfbbox() / imagettftext() unconditionally (on 14.3 GifBuilder::ImageTTFBBoxWrapper() / ImageTTFTextWrapper() call them directly). Check::checkGdLibFreeTypeSupport() only checks function_exists('imagettftext'), which is true for such builds. The reliable indicator is gd_info()['FreeType Support']

Reviews 1

History 12

  1. Benjamin Kott commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2026-10-22T15:25:13+00:00" > 10/22/26, 15:25 </span>

    Applied in changeset commit:29862faaf1e599c731e6563862bfeb3e865a55d0.