{"record":{"id":"e309de377cafe7de","repo":"bevyengine/bevy","slug":"could-not-extract-image-0","errorCode":null,"errorMessage":"Could not extract image: {0}","messagePattern":"Could not extract image: (.+?)","errorType":"exception","errorClass":"HdrTextureLoaderError","httpStatus":null,"severity":"error","filePath":"crates/bevy_image/src/hdr_texture_loader.rs","lineNumber":29,"sourceCode":"#[derive(Clone, Default, TypePath)]\npub struct HdrTextureLoader;\n\n/// Settings for [`HdrTextureLoader`].\n#[derive(Serialize, Deserialize, Default, Debug)]\npub struct HdrTextureLoaderSettings {\n    /// Where the asset will be used - see the docs on [`RenderAssetUsages`] for details.\n    pub asset_usage: RenderAssetUsages,\n}\n\n/// Possible errors that can be produced by [`HdrTextureLoader`]\n#[non_exhaustive]\n#[derive(Debug, Error)]\npub enum HdrTextureLoaderError {\n    /// I/O Error.\n    #[error(\"Could load texture: {0}\")]\n    Io(#[from] std::io::Error),\n    /// Failed to decode the texture.\n    #[error(\"Could not extract image: {0}\")]\n    Image(#[from] image::ImageError),\n}\n\nimpl AssetLoader for HdrTextureLoader {\n    type Asset = Image;\n    type Settings = HdrTextureLoaderSettings;\n    type Error = HdrTextureLoaderError;\n    async fn load(\n        &self,\n        reader: &mut dyn Reader,\n        settings: &Self::Settings,\n        _load_context: &mut LoadContext<'_>,\n    ) -> Result<Image, Self::Error> {\n        let format = TextureFormat::Rgba32Float;\n        // `Rgba32Float` will always return a valid pixel size\n        let pixel_size = format.pixel_size().unwrap();\n        debug_assert_eq!(pixel_size, 4 * 4, \"Format should have 32bit x 4 size\");\n","sourceCodeStart":11,"sourceCodeEnd":47,"githubUrl":"https://github.com/bevyengine/bevy/blob/396ca727080776bd313bb892423b7d94e03b81b4/crates/bevy_image/src/hdr_texture_loader.rs#L11-L47","documentation":"HdrTextureLoaderError decoding variant: the HDR file was read but its pixel data could not be extracted/decoded into an Image (malformed or unsupported HDR payload).","triggerScenarios":"Thrown at crates/bevy_image/src/hdr_texture_loader.rs:29 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Re-save the .hdr file with a mainstream encoder","Check the file is actually Radiance HDR format","Handle the loader error and use a fallback texture"],"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-14T05:17:10.506Z"}