{"record":{"id":"db8c0b9297f87d6a","repo":"bevyengine/bevy","slug":"saveimageformatsetting-fromextension-was-set-but","errorCode":null,"errorMessage":"SaveImageFormatSetting::FromExtension was set, but the asset path \"{0}\" has no extension","messagePattern":"SaveImageFormatSetting::FromExtension was set, but the asset path \"(.+?)\" has no extension","errorType":"exception","errorClass":"SaveImageError","httpStatus":null,"severity":"error","filePath":"crates/bevy_image/src/saver.rs","lineNumber":130,"sourceCode":"    /// Defines the file format that the image will be saved as.\n    pub format: SaveImageFormatSetting,\n}\n\n/// 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),","sourceCodeStart":112,"sourceCodeEnd":148,"githubUrl":"https://github.com/bevyengine/bevy/blob/396ca727080776bd313bb892423b7d94e03b81b4/crates/bevy_image/src/saver.rs#L112-L148","documentation":"SaveImageError variant raised when the image saver is configured with SaveImageFormatSetting::FromExtension (the default) but the target AssetPath carries no file extension, so no format can be deduced. Fix by giving the path an extension or setting an explicit Format(ImageFormat).","triggerScenarios":"Thrown at crates/bevy_image/src/saver.rs:130 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Give the asset path a file extension (e.g. .png)","Set an explicit format via SaveImageFormatSetting::Format(ImageFormat) instead of relying on the extension"],"exampleFix":null,"handlingStrategy":"validation","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"}