{"record":{"id":"3dc5325f66b39472","repo":"Intervention/image","slug":"target-colorspace-target-is-not-supported-by-d","errorCode":null,"errorMessage":"Target colorspace \"{target}\" is not supported by driver","messagePattern":"Target colorspace \"(.+?)\" is not supported by driver","errorType":"exception","errorClass":"NotSupportedException","httpStatus":null,"severity":"error","filePath":"src/Modifiers/ColorspaceModifier.php","lineNumber":39,"sourceCode":"        //\n    }\n\n    /**\n     * Build the target color space.\n     *\n     * @throws NotSupportedException\n     */\n    protected function targetColorspace(): ColorspaceInterface\n    {\n        if ($this->target instanceof ColorspaceInterface) {\n            return $this->target;\n        }\n\n        if (class_exists($this->target)) {\n            $colorspace = new $this->target();\n\n            if (!$colorspace instanceof ColorspaceInterface) {\n                throw new NotSupportedException(\n                    'Target colorspace \"' . $this->target . '\" is not supported by driver',\n                );\n            }\n\n            return $colorspace;\n        }\n\n        return match (strtolower($this->target)) {\n            'rgb', 'srgb', 'rgba', 'srgba' => new Rgb(),\n            'cmyk' => new Cmyk(),\n            'hsl' => new Hsl(),\n            'hsv', 'hsb' => new Hsv(),\n            'oklab' => new Oklab(),\n            'oklch' => new Oklch(),\n            default => throw new NotSupportedException(\n                'Colorspace is not supported by driver',\n            ),\n        };","sourceCodeStart":21,"sourceCodeEnd":57,"githubUrl":"https://github.com/Intervention/image/blob/5598b9e39751c34afc5cdee84abef77f92c26f68/src/Modifiers/ColorspaceModifier.php#L21-L57","documentation":"Error \"Target colorspace \"{target}\" is not supported by driver\" thrown in Intervention/image.","triggerScenarios":"Thrown at src/Modifiers/ColorspaceModifier.php:39 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use a colorspace supported by your driver, e.g. Intervention\\Image\\Colors\\Rgb\\Colorspace::class for GD","Check DriverInterface::supports() or driver()->colorSpaces() (driver capabilities) before calling setColorspace()","Convert via a supported intermediate colorspace if the target is unavailable"],"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"}