{"record":{"id":"96792a418a0d18d7","repo":"Intervention/image","slug":"unable-to-retrieve-unsupported-file-extension-for","errorCode":null,"errorMessage":"Unable to retrieve unsupported file extension for format","messagePattern":"Unable to retrieve unsupported file extension for format","errorType":"exception","errorClass":"Intervention\\Image\\Exceptions\\NotSupportedException","httpStatus":null,"severity":"error","filePath":"src/Format.php","lineNumber":142,"sourceCode":"        return array_filter(\n            FileExtension::cases(),\n            fn(FileExtension $fileExtension): bool => $fileExtension->format() === $this,\n        );\n    }\n\n    /**\n     * Return the first found file extension for the current format.\n     *\n     * @throws NotSupportedException\n     */\n    public function fileExtension(): FileExtension\n    {\n        $extensions = $this->fileExtensions();\n\n        $result = reset($extensions);\n\n        if (!$result instanceof FileExtension) {\n            throw new NotSupportedException('Unable to retrieve unsupported file extension for format');\n        }\n\n        return $result;\n    }\n\n    /**\n     * Create an encoder instance with given options that matches the format.\n     */\n    public function encoder(mixed ...$options): EncoderInterface\n    {\n        // get classname of target encoder from current format\n        $classname = match ($this) {\n            self::AVIF => AvifEncoder::class,\n            self::BMP => BmpEncoder::class,\n            self::GIF => GifEncoder::class,\n            self::HEIC => HeicEncoder::class,\n            self::ICO => IcoEncoder::class,\n            self::JP2 => Jpeg2000Encoder::class,","sourceCodeStart":124,"sourceCodeEnd":160,"githubUrl":"https://github.com/Intervention/image/blob/5598b9e39751c34afc5cdee84abef77f92c26f68/src/Format.php#L124-L160","documentation":"Error \"Unable to retrieve unsupported file extension for format\" thrown in Intervention/image.","triggerScenarios":"Thrown at src/Format.php:142 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Call fileExtension() only for formats with a mapped extension; consult the Format enum cases for supported values","Provide the extension explicitly when saving (e.g. ->save(path: 'out.jpg')) instead of deriving it from an unmapped format","Check for typos in custom format identifiers before relying on automatic extension resolution"],"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"}