Unable to use gif images in plugin with v4.3.1

I just upgraded a website from v3.7.11 to v4.3.1. The website uses a plugin where a record contains a gallery via the fileupload form field. The mode is image and the maxFiles is set to 12. When trying to load a record containing 1 gif (approx 300kb) and 6 webp images (all under 300kb) I get the following error:

Allowed memory size of 536870912 bytes exhausted (tried to allocate 5760001 bytes)

{
    "exception": {
        "class": "Symfony\\Component\\ErrorHandler\\Error\\FatalError",
        "message": "Allowed memory size of 536870912 bytes exhausted (tried to allocate 5760001 bytes)",
        "code": 0,
        "file": "~/vendor/intervention/gif/src/Splitter.php",
        "line": 206,
        "trace": []
    }
}

The PHP memory limit is set to 512MB. It works fine on v3.7.11, but not on the latest version.

V4 uses the intervention image php library made by a third party.

It looks like it’s failing at that step in the error message too.

Since the error occurs while Intervention is processing the animated GIF frames, it might be worth trying the Imagick driver instead, if available on your server. Intervention Image supports Imagick as an alternative to GD and it may handle this case with less pressure on PHP’s memory limit.

1 Like