Text overlay broken because of TypeError exception

Created on 5 February 2025, 2 months ago

Problem/Motivation

When using a text overlay image operation the following exception is thrown:

TypeError: Drupal\image_effects\Plugin\ImageToolkit\Operation\gd\TextOverlay::imagettftextWrapper(): Argument #4 ($x) must be of type int, float given, called in /var/www/web/modules/contrib/image_effects/src/Plugin/ImageToolkit/Operation/gd/TextOverlay.php on line 91

Steps to reproduce

* Install image_effects 4.0.0
* Create an image style that uses a text overlay effect
* Make sure text alignment is set to center
* Test the preview of the text overlay effect

Proposed resolution

Because the method parameters are typed they expect int coordinates. When centering image text however a round function is applied to the x_offset, casting it to a double.

🐛 Bug report
Status

Active

Version

4.0

Component

Code

Created by

🇧🇪Belgium klaasvw

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024