{"record":{"id":"711c06921bf97f2d","repo":"Intervention/image","slug":"unable-to-create-file-extension-from-identifier-711c06","errorCode":null,"errorMessage":"Unable to create file extension from \"{$identifier->value}\"","messagePattern":"Unable to create file extension from \"(.+?)\"","errorType":"exception","errorClass":"Intervention\\Image\\Exceptions\\InvalidArgumentException","httpStatus":null,"severity":"error","filePath":"src/FileExtension.php","lineNumber":64,"sourceCode":"            return $identifier;\n        }\n\n        if ($identifier instanceof Format) {\n            try {\n                return $identifier->fileExtension();\n            } catch (NotSupportedException $e) {\n                throw new InvalidArgumentException(\n                    'Unable to create file extension from \"' . $identifier::class . '\"',\n                    previous: $e,\n                );\n            }\n        }\n\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    }","sourceCodeStart":46,"sourceCodeEnd":82,"githubUrl":"https://github.com/Intervention/image/blob/5598b9e39751c34afc5cdee84abef77f92c26f68/src/FileExtension.php#L46-L82","documentation":"Error \"Unable to create file extension from \"{$identifier->value}\"\" thrown in Intervention/image.","triggerScenarios":"Thrown at src/FileExtension.php:64 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use one of the backed enum values that maps to a known file extension, e.g. Format::JPEG->value","Check spelling/casing of the media type or format string passed to the enum","Extend the mapping only via supported formats; unknown enum values cannot be converted to an extension"],"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"}