{"record":{"id":"997ab71e814ed07b","repo":"flarum/framework","slug":"invalid-image-type","errorCode":null,"errorMessage":"Invalid image type","messagePattern":"Invalid image type","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"framework/core/src/Extension/Extension.php","lineNumber":251,"sourceCode":"    {\n        return $this->abandoned;\n    }\n\n    public function getIcon(): ?array\n    {\n        $icon = $this->composerJsonAttribute('extra.flarum-extension.icon');\n        $file = Arr::get($icon, 'image');\n\n        if (is_null($icon) || is_null($file)) {\n            return $icon;\n        }\n\n        $file = $this->path.'/'.$file;\n\n        if (file_exists($file)) {\n            $extension = pathinfo($file, PATHINFO_EXTENSION);\n            if (! array_key_exists($extension, self::LOGO_MIMETYPES)) {\n                throw new \\RuntimeException('Invalid image type');\n            }\n\n            $mimetype = self::LOGO_MIMETYPES[$extension];\n            $data = base64_encode(file_get_contents($file));\n\n            $icon['backgroundImage'] = \"url('data:$mimetype;base64,$data')\";\n        }\n\n        return $icon;\n    }\n\n    public function getIconStyles(): string\n    {\n        $properties = $this->getIcon();\n\n        if (empty($properties)) {\n            return '';\n        }","sourceCodeStart":233,"sourceCodeEnd":269,"githubUrl":"https://github.com/flarum/framework/blob/4b939f685389bfe8a380e9e28ddf305a1c66950c/framework/core/src/Extension/Extension.php#L233-L269","documentation":"Thrown in Extension::getIcon when the extension's composer.json declares extra.flarum-extension.icon.image pointing to a file whose extension is not in the LOGO_MIMETYPES allow-list (known image types only). The icon cannot be inlined as a base64 data URI, so building the extension's metadata fails with a RuntimeException. The faulting input is the icon image path/extension declared in the extension's composer.json.","triggerScenarios":"Thrown at framework/core/src/Extension/Extension.php:251 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Change the icon.image file in composer.json to a supported type (per LOGO_MIMETYPES, e.g. png)","Rename/convert the icon file so its extension matches its actual format","Report the issue to the extension author so they fix the declared icon","Temporarily remove the icon.image key from composer.json"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4b939f685389bfe8a380e9e28ddf305a1c66950c","analyzedAt":"2026-09-15T18:09:20.879Z","contentChangedAt":"2026-09-15T18:09:20.879Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}