{"record":{"id":"a67da4444c47271d","repo":"bevyengine/bevy","slug":"unsupported-texture-format-for-compression-0","errorCode":null,"errorMessage":"Unsupported texture format for compression: {0:?}","messagePattern":"Unsupported texture format for compression: (.+?)","errorType":"exception","errorClass":"CompressedImageSaverError","httpStatus":null,"severity":"error","filePath":"crates/bevy_image/src/compressed_image_saver/mod.rs","lineNumber":215,"sourceCode":"    /// The image has no alpha channel.\n    Opaque,\n}\n\n/// Errors encountered when writing compressed images via [`CompressedImageSaver`].\n#[non_exhaustive]\n#[derive(Debug, Error, TypePath)]\npub enum CompressedImageSaverError {\n    /// I/O error.\n    #[error(transparent)]\n    Io(#[from] std::io::Error),\n    /// The underlying compression library returned an error.\n    #[error(transparent)]\n    CompressionFailed(Box<dyn core::error::Error + Send + Sync>),\n    /// Attempted to save an image with uninitialized data.\n    #[error(\"Cannot compress an uninitialized image\")]\n    UninitializedImage,\n    /// The texture format is not supported for compression.\n    #[error(\"Unsupported texture format for compression: {0:?}\")]\n    UnsupportedFormat(TextureFormat),\n    /// `is_normal_map` was set, but the input [`Image`]'s `texture_descriptor.format` is an sRGB\n    /// variant (e.g. `Rgba8UnormSrgb`). Normal maps must be stored as linear vector data. Typically this means\n    /// configuring the [`ImageLoaderSettings`] with `is_srgb: false` for this image.\n    #[error(\n        \"Cannot compress an sRGB texture ({0:?}) as a normal map; \\\n         the input Image's texture_descriptor.format must be a non-sRGB (linear) variant\"\n    )]\n    NormalMapMustBeLinear(TextureFormat),\n}\n","sourceCodeStart":197,"sourceCodeEnd":226,"githubUrl":"https://github.com/bevyengine/bevy/blob/396ca727080776bd313bb892423b7d94e03b81b4/crates/bevy_image/src/compressed_image_saver/mod.rs#L197-L226","documentation":"CompressedImageSaverError::UnsupportedTextureFormat: the image's TextureFormat is not one the compression backend can encode, so the save is refused with the offending format listed.","triggerScenarios":"Thrown at crates/bevy_image/src/compressed_image_saver/mod.rs:215 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Convert the image to a compressible format (e.g. Rgba8UnormSrgb) before saving","Use a different ImageSaver that accepts the format","Skip compression for unsupported formats and save uncompressed"],"exampleFix":null,"handlingStrategy":"try-catch","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"}