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.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

klaasvw created an issue. See original summary.

klaasvw’s picture

Status: Active » Closed (duplicate)
Related issues: +#3494550: TypeError in using Textoverlay