ReviewOS

home-lang/home

Port NAPI-RS Canvas and Jimp raster contracts

#212
Closed chris opened this 10 days ago ·
10 days ago

Context

The sequential Bun corpus frontier is js/third_party/@napi-rs/canvas/napi-rs-canvas.test.ts at position 3952/4708, following completed Fastify WebSocket work in #211. This contributes to #66.

Current gap

The module is classified as unsupported module syntax because @napi-rs/canvas and jimp are not yet represented. The copied test compares exact 200×200 RGBA output after fill, stroke, PNG load, and draw operations.

Acceptance criteria

  • Named @napi-rs/canvas and jimp imports prepare and resolve.
  • Canvas 2D fill/stroke state and rectangle rasterization match the tested behavior.
  • loadImage() decodes the copied RGBA PNG fixture.
  • drawImage() copies the source pixels with correct positioning/clipping.
  • encode('png') / Jimp.read() preserve exact bitmap data for comparison.
  • The copied test passes and is pinned in the permanent third-party gate.
10 days ago

Completed on main in 5b60016.

The adapter now resolves @napi-rs/canvas and Jimp, decodes 8-bit non-interlaced PNG data with DEFLATE and PNG filters, rasterizes fill/stroke rectangles, alpha-composites loaded images with clipping, encodes genuine RGBA PNG output, and has Jimp compare decoded bitmap pixels. The copied test passes 1/1 and is pinned in the permanent third-party gate.

Verification: focused position 3952 reports files=1, passed=1, failed=0, todo=0, unsupported=0, allowed-empty=0; all three permanent gates pass.

Sign in to comment on this issue.