{"record":{"id":"eefd03171f13f049","repo":"Intervention/image","slug":"failed-to-apply-intervention-image-drivers-imagick-eefd03","errorCode":null,"errorMessage":"Failed to apply Intervention\\Image\\Drivers\\Imagick\\Modifiers\\CropModifier, unable to set animation details","messagePattern":"Failed to apply Intervention\\\\Image\\\\Drivers\\\\Imagick\\\\Modifiers\\\\CropModifier, unable to set animation details","errorType":"exception","errorClass":"ModifierException","httpStatus":null,"severity":"error","filePath":"src/Drivers/Imagick/Modifiers/CropModifier.php","lineNumber":82,"sourceCode":"                    Hsv::class => Imagick::COLORSPACE_HSB,\n                    Hsl::class => Imagick::COLORSPACE_HSL,\n                    default => Imagick::COLORSPACE_SRGB,\n                });\n            } catch (ImagickException $e) {\n                throw new ModifierException(\n                    'Failed to apply ' . self::class . ', unable to create new frame canvas',\n                    previous: $e,\n                );\n            }\n\n            // set animation details\n            if ($image->isAnimated()) {\n                try {\n                    $canvas->setImageDelay($frame->native()->getImageDelay());\n                    $canvas->setImageIterations($frame->native()->getImageIterations());\n                    $canvas->setImageDispose($frame->native()->getImageDispose());\n                } catch (ImagickException $e) {\n                    throw new ModifierException(\n                        'Failed to apply ' . self::class . ', unable to set animation details',\n                        previous: $e,\n                    );\n                }\n            }\n\n            // make the rectangular position of the original image transparent\n            // so that we can later place the original on top. this preserves\n            // the transparency of the original and shows the background color\n            // of the modifier in the other areas. if the original image has no\n            // transparent area the rectangular transparency will be covered by\n            // the original.\n            try {\n                $clearer = new Imagick();\n                $clearer->newImage(\n                    $frame->native()->getImageWidth(),\n                    $frame->native()->getImageHeight(),\n                    new ImagickPixel('black'),","sourceCodeStart":64,"sourceCodeEnd":100,"githubUrl":"https://github.com/Intervention/image/blob/5598b9e39751c34afc5cdee84abef77f92c26f68/src/Drivers/Imagick/Modifiers/CropModifier.php#L64-L100","documentation":"Error \"Failed to apply Intervention\\Image\\Drivers\\Imagick\\Modifiers\\CropModifier, unable to set animation details\" thrown in Intervention/image.","triggerScenarios":"Thrown at src/Drivers/Imagick/Modifiers/CropModifier.php:82 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Apply crop() only to images that were decoded with a valid Imagick instance; a corrupt source can lose its animation metadata","When cropping animated images, keep the original frame delay/iterations readable by the driver (do not stripImag or deconstruct the Imagick object before cropping)","Upgrade imagick if setImageDelay/setImageIterations calls fail on the new frame"],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5598b9e39751c34afc5cdee84abef77f92c26f68","analyzedAt":"2026-08-23T02:17:31.068Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}