slint-ui/slint · error

The image cannot be rendered

Error message

The image cannot be rendered

What it means

The software renderer's texture/image drawing path only supports image types it can process through its texture processor (scaled/rotated/tilted raster images). When the image kind does not correspond to a processable texture (e.g. certain embedded or special image representations), it panics with this message.

Solutions

  1. Use a standard decoded image format (e.g. PNG/JPEG decoded via the image feature) instead of the unsupported representation
  2. Enable the appropriate image-decoding feature flags of the slint crate so the image is converted to a renderable texture
  3. Simplify image properties (tiling/rotation) that may push the image down the unsupported path, or render with femtovg/skia instead
Defensive patterns

Strategy: fallback

Validate before calling

// Prefer decoded images the software renderer can handle
let img = image::load_from_memory(bytes)?; // decode on host instead of opaque handles

Prevention

When it happens

Trigger: Rendering an image with the `renderer-software` backend where the image cache yields a texture variant that the draw path does not recognize as processable — e.g. an image format the software pipeline cannot handle, or an unsupported tiling/rotation combination with that image kind.

Common situations: Embedded no-std targets using the software renderer displaying an image type not supported by the CPU pipeline; images loaded via mechanisms that bypass the normal decoded-image path (e.g. raw borrowed buffers the software renderer cannot consume).

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


AI-assisted analysis of slint-ui/slint@3a7e700487 (2026-09-16). Data as JSON: /api/errors/57252f90afdfff63. Report an issue: GitHub.

Appendix: source

Thrown at internal/renderers/software/lib.rs:2432

                                        buf_size.height / orig.height,
                                    )
                                    .round()
                                    .cast(),
                            ),
                        },
                        colorize: (colorize.alpha() > 0).then_some(colorize),
                        alpha,
                        dst_x: target_rect.origin.x as _,
                        dst_y: target_rect.origin.y as _,
                        dst_width: target_rect.size.width as _,
                        dst_height: target_rect.size.height as _,
                        rotation: self.rotation.orientation,
                        tiling,
                    };

                    self.processor.process_target_texture(&t, clipped_target.cast());
                } else {
                    unimplemented!("The image cannot be rendered")
                }
            }
        };
    }

    fn draw_text_paragraph<Font>(
        &mut self,
        paragraph: &TextParagraphLayout<'_, Font>,
        physical_clip: euclid::Rect<f32, PhysicalPx>,
        offset: euclid::Vector2D<f32, PhysicalPx>,
        color: Color,
        selection: Option<SelectionInfo>,
    ) where
        Font: AbstractFont
            + i_slint_core::textlayout::TextShaper<Length = PhysicalLength>
            + GlyphRenderer,
    {
        let slint_context = self.window.context();

View on GitHub (pinned to 3a7e700487)