{"record":{"id":"615c5f354f8d80ba","repo":"Intervention/image","slug":"unable-to-create-file-extension-from-identifier-615c5f","errorCode":null,"errorMessage":"Unable to create file extension from \"{$identifier}\"","messagePattern":"Unable to create file extension from \"(.+?)\"","errorType":"exception","errorClass":"Intervention\\Image\\Exceptions\\InvalidArgumentException","httpStatus":null,"severity":"error","filePath":"src/FileExtension.php","lineNumber":77,"sourceCode":"\n        if ($identifier instanceof MediaType) {\n            try {\n                return $identifier->fileExtension();\n            } catch (NotSupportedException $e) {\n                throw new InvalidArgumentException(\n                    'Unable to create file extension from \"' . $identifier->value . '\"',\n                    previous: $e,\n                );\n            }\n        }\n\n        try {\n            $extension = self::from(strtolower($identifier));\n        } catch (Error) {\n            try {\n                $extension = MediaType::from(strtolower($identifier))->fileExtension();\n            } catch (Error | NotSupportedException) {\n                throw new InvalidArgumentException('Unable to create file extension from \"' . $identifier . '\"');\n            }\n        }\n\n        return $extension;\n    }\n\n    /**\n     * Try to create media type from given identifier and return null on failure.\n     */\n    public static function tryCreate(string|self|Format|MediaType $identifier): ?self\n    {\n        try {\n            return self::create($identifier);\n        } catch (InvalidArgumentException) {\n            return null;\n        }\n    }\n","sourceCodeStart":59,"sourceCodeEnd":95,"githubUrl":"https://github.com/Intervention/image/blob/5598b9e39751c34afc5cdee84abef77f92c26f68/src/FileExtension.php#L59-L95","documentation":"Error \"Unable to create file extension from \"{$identifier}\"\" thrown in Intervention/image.","triggerScenarios":"Thrown at src/FileExtension.php:77 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a valid file extension or path such as \"jpg\", \".png\" or \"image.gif\"","Strip query strings or fragments from URLs before extracting the extension","Match the extension against the library's supported formats; unknown extensions (e.g. \".foo\") cannot be resolved"],"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"}