GD toolkit & operations should fail gracefully in case of memory issues

Created on 3 February 2023, over 1 year ago
Updated 10 February 2023, over 1 year ago

Problem/Motivation

Follow up for 🐛 GD toolkit & operations should catch \Throwable to fail gracefully in case of errors Fixed .

In some PHP configurations, executing something like this

      $test = \Drupal::service('image.factory')->get(NULL, 'gd');
      $test->createNew(20000, 20000);

leads to a fatal error

PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 80000 bytes) in /[...]/core/modules/system/src/Plugin/ImageToolkit/Operation/gd/CreateNew.php on line 94

and WSOD.

This is because GD imagexxx functions do not return gracefully in case of memory allocation failures.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Needs work

Version

10.1

Component
Image system 

Last updated 1 day ago

Created by

🇮🇹Italy mondrake 🇮🇹

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

Comments & Activities

Production build 0.69.0 2024