{"record":{"id":"3dea05bf5f5dc834","repo":"Intervention/image","slug":"failed-to-apply-intervention-image-drivers-imagick-3dea05","errorCode":null,"errorMessage":"Failed to apply Intervention\\Image\\Drivers\\Imagick\\Modifiers\\CropModifier, unable to clear transparent areas","messagePattern":"Failed to apply Intervention\\\\Image\\\\Drivers\\\\Imagick\\\\Modifiers\\\\CropModifier, unable to clear transparent areas","errorType":"exception","errorClass":"ModifierException","httpStatus":null,"severity":"error","filePath":"src/Drivers/Imagick/Modifiers/CropModifier.php","lineNumber":112,"sourceCode":"            // the original.\n            try {\n                $clearer = new Imagick();\n                $clearer->newImage(\n                    $frame->native()->getImageWidth(),\n                    $frame->native()->getImageHeight(),\n                    new ImagickPixel('black'),\n                );\n                $canvas->compositeImage($clearer, Imagick::COMPOSITE_DSTOUT, ...$position);\n                $clearer->clear();\n\n                // place original frame content onto prepared frame canvas\n                $canvas->compositeImage($frame->native(), Imagick::COMPOSITE_DEFAULT, ...$position);\n\n                // add newly built frame to container imagick\n                $imagick->addImage($canvas);\n                $canvas->clear();\n            } catch (ImagickException | ImagickPixelException $e) {\n                throw new ModifierException(\n                    'Failed to apply ' . self::class . ', unable to clear transparent areas',\n                    previous: $e,\n                );\n            }\n        }\n\n        // replace imagick in the original image\n        $image->core()->setNative($imagick);\n\n        return $image;\n    }\n}\n","sourceCodeStart":94,"sourceCodeEnd":125,"githubUrl":"https://github.com/Intervention/image/blob/5598b9e39751c34afc5cdee84abef77f92c26f68/src/Drivers/Imagick/Modifiers/CropModifier.php#L94-L125","documentation":"Error \"Failed to apply Intervention\\Image\\Drivers\\Imagick\\Modifiers\\CropModifier, unable to clear transparent areas\" thrown in Intervention/image.","triggerScenarios":"Thrown at src/Drivers/Imagick/Modifiers/CropModifier.php:112 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the cropped image has an alpha channel before transparent-area clearing, e.g. call $image->core()->native()->setImageAlphaChannel(...) or use a format that supports transparency","Verify the background color passed for clearing is parseable by ImagickPixel","Check that the crop rectangle did not produce a zero-size image"],"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"}