Intervention/image · error · ModifierException

Failed to apply Intervention\Image\Drivers\Imagick\Modifiers

Error message

Failed to apply Intervention\Image\Drivers\Imagick\Modifiers\CropModifier, unable to set animation details

What it means

Error "Failed to apply Intervention\Image\Drivers\Imagick\Modifiers\CropModifier, unable to set animation details" thrown in Intervention/image.

Source

Thrown at src/Drivers/Imagick/Modifiers/CropModifier.php:82

                    Hsv::class => Imagick::COLORSPACE_HSB,
                    Hsl::class => Imagick::COLORSPACE_HSL,
                    default => Imagick::COLORSPACE_SRGB,
                });
            } catch (ImagickException $e) {
                throw new ModifierException(
                    'Failed to apply ' . self::class . ', unable to create new frame canvas',
                    previous: $e,
                );
            }

            // set animation details
            if ($image->isAnimated()) {
                try {
                    $canvas->setImageDelay($frame->native()->getImageDelay());
                    $canvas->setImageIterations($frame->native()->getImageIterations());
                    $canvas->setImageDispose($frame->native()->getImageDispose());
                } catch (ImagickException $e) {
                    throw new ModifierException(
                        'Failed to apply ' . self::class . ', unable to set animation details',
                        previous: $e,
                    );
                }
            }

            // make the rectangular position of the original image transparent
            // so that we can later place the original on top. this preserves
            // the transparency of the original and shows the background color
            // of the modifier in the other areas. if the original image has no
            // transparent area the rectangular transparency will be covered by
            // the original.
            try {
                $clearer = new Imagick();
                $clearer->newImage(
                    $frame->native()->getImageWidth(),
                    $frame->native()->getImageHeight(),
                    new ImagickPixel('black'),

View on GitHub (pinned to 5598b9e397)

Solutions

  1. Apply crop() only to images that were decoded with a valid Imagick instance; a corrupt source can lose its animation metadata
  2. When cropping animated images, keep the original frame delay/iterations readable by the driver (do not stripImag or deconstruct the Imagick object before cropping)
  3. Upgrade imagick if setImageDelay/setImageIterations calls fail on the new frame

When it happens

Trigger: Thrown at src/Drivers/Imagick/Modifiers/CropModifier.php:82 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of Intervention/image@5598b9e397 (2026-08-23). Data as JSON: /api/errors/eefd03171f13f049. Report an issue: GitHub.