19. Image Viewing and Inspection
Image Viewing and Inspection requirements from the authoritative Glitchpad Technical Specification.
Image support activates in v0.2.0. Required raster formats are PNG, JPEG, GIF, WebP, BMP, and TIFF. SVG and ICO are separate variants under the image renderer family.
The renderer provides fit, actual-size, zoom, pan, background selection for transparency, orientation handling, pixel dimensions, animation pause/resume, frame position, and metadata inspection. It does not modify image pixels or write image containers.
Rust identifies and validates containers before presentation. The image crate uses explicit codec features. WebView decoding may provide a display fast path only after native size and format checks. A separate libwebp dependency is not part of the baseline because pure-Rust and system decoders satisfy required WebP behavior without a C packaging surface.
ICO inspection lists each directory entry with width, height, bit depth, encoding, byte size, and validity. The user may preview and export one embedded entry as PNG without altering the source.
SVG is parsed by usvg and rendered by resvg. Scripts, event handlers, foreign objects, external styles, fonts, images, links, and network references are discarded or reported. Untrusted SVG is never inserted directly into the application DOM.