{"record":{"id":"57252f90afdfff63","repo":"slint-ui/slint","slug":"the-image-cannot-be-rendered","errorCode":null,"errorMessage":"The image cannot be rendered","messagePattern":"The image cannot be rendered","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/renderers/software/lib.rs","lineNumber":2485,"sourceCode":"                                        buf_size.height / orig.height,\n                                    )\n                                    .round()\n                                    .cast(),\n                            ),\n                        },\n                        colorize: (colorize.alpha() > 0).then_some(colorize),\n                        alpha,\n                        dst_x: target_rect.origin.x as _,\n                        dst_y: target_rect.origin.y as _,\n                        dst_width: target_rect.size.width as _,\n                        dst_height: target_rect.size.height as _,\n                        rotation: self.rotation.orientation,\n                        tiling,\n                    };\n\n                    self.processor.process_target_texture(&t, clipped_target.cast());\n                } else {\n                    unimplemented!(\"The image cannot be rendered\")\n                }\n            }\n        };\n    }\n\n    fn draw_text_paragraph<Font>(\n        &mut self,\n        paragraph: &TextParagraphLayout<'_, Font>,\n        physical_clip: euclid::Rect<f32, PhysicalPx>,\n        offset: euclid::Vector2D<f32, PhysicalPx>,\n        color: Color,\n        selection: Option<SelectionInfo>,\n    ) where\n        Font: AbstractFont\n            + i_slint_core::textlayout::TextShaper<Length = PhysicalLength>\n            + GlyphRenderer,\n    {\n        let slint_context = self.window.context();","sourceCodeStart":2467,"sourceCodeEnd":2503,"githubUrl":"https://github.com/slint-ui/slint/blob/a9ea814a5813e7460fa1a867924872095a4d678d/internal/renderers/software/lib.rs#L2467-L2503","documentation":"In the software (CPU) renderer's draw_image path, after the static-texture fast path and an unreachable NineSlice arm, the fallback rasterizes via image_inner.render_to_buffer(svg_target_size). If that returns None — the image variant has no CPU-renderable buffer, e.g. a default/invalid image from a failed load, or an SVG without SVG rasterization support compiled in — the code hits `unimplemented!(\"The image cannot be rendered\")` and panics during rendering.","triggerScenarios":"Drawing an Image with the software renderer where the underlying image could not be turned into pixels: bad @image-url path / missing resource, an image format not enabled in the build, or an SVG when SVG support (image decoding features of i-slint-core) is absent — typically on embedded targets using renderer-software.","commonSituations":"Embedded build missing the image-formats/svg cargo features; image file not packaged at the path referenced by the .slint; assets renamed but markup not updated; desktop test build with a stripped-down feature set.","solutions":["Check that every @image-url path resolves at runtime and the files are shipped with the app.","Enable the needed cargo features of i-slint-core (image-formats for the formats you use, SVG support for .svg assets).","Convert assets to broadly supported formats (e.g. PNG) at build time instead of relying on exotic decoders.","If a valid, supported image still triggers the panic, capture the ImageInner variant (e.g. via debugger) and report upstream."],"exampleFix":"# before (Cargo.toml)\ni-slint-core = { version = \"...\", default-features = false, features = [\"renderer-software\"] }\n# .slint references an .svg -> panic: The image cannot be rendered\n\n# after\ni-slint-core = { version = \"...\", default-features = false, features = [\n    \"renderer-software\",\n    \"image-formats\",   # enables decoders incl. SVG path used by the software renderer\n] }","handlingStrategy":"validation","validationCode":"// Fail fast at startup: verify every image referenced by the assets actually loads\nuse i_slint_core::graphics::Image;\nfor path in [\"assets/logo.svg\", \"assets/bg.png\"] {\n    assert!(Image::load_from_path(std::path::Path::new(path)).is_ok(),\n        \"image asset missing or unsupported: {path}\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Enable the i-slint-core features your assets need (image-formats, SVG support) when using renderer-software.","Ship a startup asset check that loads every referenced image before the event loop runs.","Prefer PNG or widely supported formats on embedded software-rendered targets."],"tags":["software-renderer","image","svg","embedded","panic"],"backgroundTag":"image-render-unsupported","analyzedSha":"a9ea814a5813e7460fa1a867924872095a4d678d","analyzedAt":"2026-08-16T22:39:12.830Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}