{"record":{"id":"633b56a2e82468cc","repo":"bevyengine/bevy","slug":"could-not-determine-asset-format-for-extension-0","errorCode":null,"errorMessage":"could not determine asset format for extension \"{0}\"","messagePattern":"could not determine asset format for extension \"(.+?)\"","errorType":"exception","errorClass":"SaveImageError","httpStatus":null,"severity":"error","filePath":"crates/bevy_image/src/saver.rs","lineNumber":134,"sourceCode":"/// The setting for how to choose which file-format to use.\n#[derive(Serialize, Deserialize, Default, Clone, Copy, Debug)]\npub enum SaveImageFormatSetting {\n    /// The file format to write will be deduced from the file path being written to.\n    #[default]\n    FromExtension,\n    /// This is the explicit file format being written.\n    Format(ImageFormat),\n}\n\n/// An error while saving an image.\n#[derive(Error, Debug)]\npub enum SaveImageError {\n    /// Cannot deduce file format from extension because there is no extension.\n    #[error(\"SaveImageFormatSetting::FromExtension was set, but the asset path \\\"{0}\\\" has no extension\")]\n    MissingExtension(AssetPath<'static>),\n    /// Cannot deduce file format from extension since this extension is unknown. Holds the\n    /// extension that could not be matched.\n    #[error(\"could not determine asset format for extension \\\"{0}\\\"\")]\n    UnknownExtension(String),\n    /// [`Image::data`] is [`None`], so there is no data to save. See\n    /// [`RenderAssetUsages`](bevy_asset::RenderAssetUsages) for more.\n    #[error(\"the provided image does not contain any pixel data. Its data may live on the GPU (which we can't save out) due to `RenderAssetUsages`\")]\n    ImageMissingData,\n    /// The image saver doesn't support the file format being requested.\n    #[error(\"the requested file format {0:?} is not supported for saving\")]\n    UnsupportedFormat(ImageFormat),\n    /// The image saver doesn't support the texture format of the image data for the image format.\n    #[error(\"the image uses a texture format \\\"{1:?}\\\" that is not supported for saving by the image format \\\"{0:?}\\\"\")]\n    UnsupportedSaveColorTypeForFormat(ImageFormat, TextureFormat),\n    /// The [`image`] crate returned an error.\n    #[error(transparent)]\n    ImageError(#[from] image::ImageError),\n    /// Writing the bytes returned an error.\n    #[error(transparent)]\n    IoError(#[from] std::io::Error),\n}","sourceCodeStart":116,"sourceCodeEnd":152,"githubUrl":"https://github.com/bevyengine/bevy/blob/396ca727080776bd313bb892423b7d94e03b81b4/crates/bevy_image/src/saver.rs#L116-L152","documentation":"SaveImageError variant raised when the target path's file extension does not map to any known ImageFormat. The unrecognized extension is held in the payload. Choose a supported extension or specify SaveImageFormatSetting::Format.","triggerScenarios":"Thrown at crates/bevy_image/src/saver.rs:134 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use a known image extension such as .png or .jpg","Set an explicit format via SaveImageFormatSetting::Format(ImageFormat)","Register support for the custom extension before saving"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"396ca727080776bd313bb892423b7d94e03b81b4","analyzedAt":"2026-08-20T16:12:39.808Z","contentChangedAt":"2026-08-20T16:12:39.808Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}