forge
Explore
Log in

Don't you dare go Hollow

Commits

Commits on ac194aa89102ebcac07f3d96ec3e2fdccbb147a7Filtered to shims/image/src/lib.rsClear filter

2026-08-26

feat(image): decode BMP, including the shapes ImageMagick will not writeAhmet Kaan Gümüş · f1f296e
feat(image): decode BMP, including the shapes ImageMagick will not write

gpui names ImageFormat::Bmp, so the shim needed a decoder behind it. This
reads every shape the format defines: 1/2/4/8/16/24/32-bit samples, palettes
with three- or four-byte entries, BI_RLE4 and BI_RLE8, arbitrary BI_BITFIELDS
masks, bottom-up and top-down rows, and headers of every defined length from
the 12-byte OS/2 v1 to the 124-byte BITMAPV5HEADER.

Two shapes that started as refusals are decoded instead. BI_PNG and BI_JPEG
files are a BMP header wrapped around a whole file of another format, so they
are handed to this crate's own PNG and JPEG decoders. The 16-byte OS/2 v2
header is the Windows layout truncated where the two stop agreeing, so it is
read through those 16 bytes -- which is what ffmpeg does, and what the
incumbent image crate refuses.

Gate: fourteen fixtures pixel-exact against image 0.25.10, the two wrapper
files exact against the incumbent decoding their payloads directly, and the
OS/2 v2 file exact against the same picture in a header the incumbent reads.
Twenty thousand fuzz mutations across the plain and run-length paths, no
panics. Full report in lanes/image-bmp-r1.report.md.
feat(image-shim): the gpui-only surface, behind a cargo featureAhmet Kaan Gümüş · c6f0f87
feat(image-shim): the gpui-only surface, behind a cargo feature

gpui consumes half an image crate this shim never needed: Frame, Delay,
AnimationDecoder, GifDecoder, WebPDecoder, guess_format,
load_from_memory_with_format, ImageBuffer, and the Gif/Bmp/Tiff format
names. None of it belongs to still-image decoding, so it lives behind a
`gpui` feature the way chrono keeps its serde impls behind one -- a build
that does not draw windows compiles none of it, and the default surface is
unchanged.

Served by ec_image: the animation paths go through decode_animation, and
WebPDecoder::has_animation answers from webp::is_animated.
set_background_color accepts only a fully transparent colour, which is
what gpui asks for and what the frames are composited onto.

2026-08-14

feat(image): image shim over ec-imageAhmet Kaan Gümüş · 88de5e3
feat(image): image shim over ec-image

Carries the `image` name and version 0.25.10, covering exactly the surface
edith's *engine* consumes: ImageReader::open / with_guessed_format /
decode / into_dimensions, image::open, DynamicImage with to_rgb8 and its
siblings, and the three 8-bit buffer types with dimensions, get_pixel and
a Deref to the samples. Anything else upstream exposes is absent, so a new
use is a compile error rather than silently different behaviour.

The app crate's two call sites (RgbaImage::from_raw, Frame::new) are
deliberately not covered: they feed gpui::RenderImage, which is typed
against the real `image` crate gpui itself depends on. The swap therefore
cannot be a blanket [patch.crates-io] — the engine takes this crate by
rename, or the app keeps the real one. That constraint is stated in the
crate's own documentation so the replica batch does not rediscover it.