bevyengine/bevy · error · SaveImageError

the requested file format {0:?} is not supported for saving

Error message

the requested file format {0:?} is not supported for saving

What it means

Returned by SaveImageError::Format when ImageWriter::write is asked to save an image in an ImageFormat that has no corresponding encoder. The variant carries the offending ImageFormat; it fires because the format was deduced (e.g. from the asset path extension or an explicit format setting) but saving to that container is unsupported by the writer, leaving the operation unable to proceed.

Source

Thrown at crates/bevy_image/src/saver.rs:141

    Format(ImageFormat),
}

/// An error while saving an image.
#[derive(Error, Debug)]
pub enum SaveImageError {
    /// Cannot deduce file format from extension because there is no extension.
    #[error("SaveImageFormatSetting::FromExtension was set, but the asset path \"{0}\" has no extension")]
    MissingExtension(AssetPath<'static>),
    /// Cannot deduce file format from extension since this extension is unknown. Holds the
    /// extension that could not be matched.
    #[error("could not determine asset format for extension \"{0}\"")]
    UnknownExtension(String),
    /// [`Image::data`] is [`None`], so there is no data to save. See
    /// [`RenderAssetUsages`](bevy_asset::RenderAssetUsages) for more.
    #[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`")]
    ImageMissingData,
    /// The image saver doesn't support the file format being requested.
    #[error("the requested file format {0:?} is not supported for saving")]
    UnsupportedFormat(ImageFormat),
    /// The image saver doesn't support the texture format of the image data for the image format.
    #[error("the image uses a texture format \"{1:?}\" that is not supported for saving by the image format \"{0:?}\"")]
    UnsupportedSaveColorTypeForFormat(ImageFormat, TextureFormat),
    /// The [`image`] crate returned an error.
    #[error(transparent)]
    ImageError(#[from] image::ImageError),
    /// Writing the bytes returned an error.
    #[error(transparent)]
    IoError(#[from] std::io::Error),
}

#[cfg(test)]
mod tests {
    use std::path::Path;

    use bevy_app::{App, TaskPoolPlugin};
    use bevy_asset::{

View on GitHub (pinned to 396ca72708)

Solutions

  1. Choose a save-supported format such as Png or Jpeg
  2. Convert the image to a savable format before saving
  3. Implement a custom saver for the exotic format
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at crates/bevy_image/src/saver.rs:141 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of bevyengine/bevy@396ca72708 (2026-08-20). Data as JSON: /api/errors/4647b74816b80158. Report an issue: GitHub.