Intervention/image · error · Intervention\Image\Exceptions\NotSupportedException

Not implemented

Error message

Not implemented

What it means

CoreInterface declares map(), but the Imagick driver's Core deliberately does not implement it — the call always throws NotSupportedException('Not implemented'). Unlike the GD driver, where frames can be mapped over cheaply, Imagick frames cannot be transformed in place that way, so this is a known capability gap of the Imagick backend, not an environment or input problem.

Source

Thrown at src/Drivers/Imagick/Core.php:72

     * @see CollectionInterface::push()
     *
     * @throws DriverException
     */
    public function push(mixed $item): CollectionInterface
    {
        return $this->add($item);
    }

    /**
     * {@inheritdoc}
     *
     * @see CoreInterface::map()
     *
     * @throws NotSupportedException
     */
    public function map(callable $callback): CoreInterface
    {
        throw new NotSupportedException('Not implemented');
    }

    /**
     * {@inheritdoc}
     *
     * @see CoreInterface::filter()
     *
     * @throws Exception
     */
    public function filter(callable $callback): CoreInterface
    {
        throw new \Exception('Not implemented');
    }

    /**
     * {@inheritdoc}
     *
     * @see CollectionInterface::get()

View on GitHub (pinned to 5598b9e397)

Solutions

  1. Iterate frames explicitly instead: foreach ($image->core() as $frame) {...} — Core implements Iterator — or use $image->core()->toArray().
  2. Branch on the driver before using map(), reserving it for the GD path.
  3. Prefer the high-level fluent API (modifiers, frame loops) over low-level Core operations where possible.

Example fix

// before
$image->core()->map(fn ($frame) => process($frame)); // Imagick driver → NotSupportedException

// after: iterate frames explicitly (Core is an Iterator)
foreach ($image->core()->toArray() as $frame) {
    process($frame);
}
Defensive patterns

Strategy: validation

Validate before calling

if ($image->driver() instanceof \Intervention\Image\Drivers\Gd\Driver) {
    $image->core()->map($callback);
} else {
    foreach ($image->core()->toArray() as $frame) {
        $callback($frame);
    }
}

Prevention

When it happens

Trigger: Calling $image->core()->map(callable) on any image loaded with the Imagick driver — typically code ported from the GD driver where map() works, or generic collection-style code that treats Core like a plain Collection.

Common situations: Shared packages that manipulate cores of both drivers; snippets copied from GD-oriented examples; abstractions that enumerate driver capabilities implicitly.

Related errors


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