fix(bridge): decode item and land art without GDI+ (#39, 2 of 2) #43

Merged
whitlocktech merged 1 commits from fix/asset-bridge-gdiplus-art into main 2026-11-26 02:23:19 -06:00
Member

What and why

servuo-plugins #39, PR 2 of 2 — finishes the Asset Bridge's GDI+-free migration for the item
and land art
plane. On a Linux/Mono shard the vendored Art.LoadStatic/LoadLand build a 16bpp
Bitmap that libgdiplus 6.1 cannot create (NotImplemented), so every static and land picture failed
before a pixel was read. PR 1 (#42) did this for the body catalogue; with this PR the whole Asset
Bridge needs no libgdiplus at all
.

Changes (overlay only)

  • BridgeArtMul.cs (new) — hand-written art.mul static + land decoder to ARGB1555, mirroring the
    vendored LoadStatic run loop and LoadLand's 44×44 diamond, with the record-and-canvas bounds the
    vendored writers lack. No System.Drawing, no Bitmap.
  • BridgeArt.cs — Render now decodes through BridgeArtMul and hues through BridgeHue (over
    hues.mul + the tiledata.mul PartialHue flag) into BridgePng, via a shared TryArtPixels
    helper the parity harness drives. Removed: the GDI+ Bitmap/ApplyTo/dispose path, the imaging
    gate, and the Files.CacheData re-check in TryHue (a key now decodes its own fresh buffer that
    nothing aliases). Added RunArtParity, the comparison harness.
  • BridgeAssets.cs — retire BitmapToPng (its last caller) and the imaging probe/field machinery;
    assets.sources no longer carries an imaging field; System.Drawing usings dropped. NO_IMAGING
    is retired with the GDI+ it guarded. Files.CacheData stays off, now only so the parity oracle's
    vendored decode returns fresh bitmaps.
  • BridgeArtParity.cs (new) — the [BridgeArtParity] GM command / BRIDGE_ART_PARITY=1 boot gate
    (the vendored oracle; the only art file that still touches System.Drawing).
  • BridgeAnimParity.cs — a doc reference fixed, and the oracle now also treats a totally-absent
    libgdiplus (DllNotFound/TypeInitialization) as "oracle unavailable".

Contract

Overlay-only; no PROTOCOL_VERSION bump (overlay.toml unchanged). The only wire change is the
removal of the additive imaging field from assets.sources; the website tolerates its absence
(every read is guarded by sources.imaging &&, so NO_IMAGING simply never fires). The spec is
updated in the paired docs PR. PNG bytes/sha256 for art change (new managed encoder, as in PR 1), so
the site re-fetches on the next warm/force — expected.

The now-dead NO_IMAGING UI/model in module-uo, the installer doctor libgdiplus row, and the
runicgateway.com docs are each tracked in a follow-up issue in their own repo.

Verification

  • dotnet build of the deployed tree: 0 warnings / 0 errors.
  • Merge gate ([BridgeArtParity], run headless):
    • Windows (vendored GDI+ oracle available): decode pass 43,433/43,433 matched (39,189 statics
      • 4,244 land), hue-33 pass 39,189/39,189 matched — MISMATCHED 0 MISSED 0 EXTRA 0. Every
        served picture is pixel-identical to the vendored decode.
    • Linux/Mono (WSL2 Ubuntu 24.04 / Mono 6.8 / libgdiplus 6.1, the live-host match): the vendored
      oracle throws NotImplemented (the #39 bug) and the managed path produced all 43,433 + 39,189.

Paired with docs PR (docs/asset-bridge-gdiplus-art). Closes the art half of #39.

🤖 Generated with Claude Code

https://claude.ai/code/session_014HJEmcaKvWQ8LsnXHKha5y

## What and why `servuo-plugins` #39, **PR 2 of 2** — finishes the Asset Bridge's GDI+-free migration for the **item and land art** plane. On a Linux/Mono shard the vendored `Art.LoadStatic`/`LoadLand` build a 16bpp `Bitmap` that libgdiplus 6.1 cannot create (`NotImplemented`), so every static and land picture failed before a pixel was read. PR 1 (#42) did this for the body catalogue; with this PR the **whole Asset Bridge needs no libgdiplus at all**. ## Changes (overlay only) - **`BridgeArtMul.cs` (new)** — hand-written `art.mul` static + land decoder to ARGB1555, mirroring the vendored `LoadStatic` run loop and `LoadLand`'s 44×44 diamond, with the record-and-canvas bounds the vendored writers lack. No `System.Drawing`, no `Bitmap`. - **`BridgeArt.cs`** — `Render` now decodes through `BridgeArtMul` and hues through `BridgeHue` (over `hues.mul` + the `tiledata.mul` `PartialHue` flag) into `BridgePng`, via a shared `TryArtPixels` helper the parity harness drives. Removed: the GDI+ `Bitmap`/`ApplyTo`/dispose path, the imaging gate, and the `Files.CacheData` re-check in `TryHue` (a key now decodes its own fresh buffer that nothing aliases). Added `RunArtParity`, the comparison harness. - **`BridgeAssets.cs`** — retire `BitmapToPng` (its last caller) and the imaging probe/field machinery; `assets.sources` no longer carries an `imaging` field; `System.Drawing` usings dropped. `NO_IMAGING` is retired with the GDI+ it guarded. `Files.CacheData` stays off, now only so the parity oracle's vendored decode returns fresh bitmaps. - **`BridgeArtParity.cs` (new)** — the `[BridgeArtParity]` GM command / `BRIDGE_ART_PARITY=1` boot gate (the vendored oracle; the only art file that still touches `System.Drawing`). - **`BridgeAnimParity.cs`** — a doc reference fixed, and the oracle now also treats a totally-absent libgdiplus (`DllNotFound`/`TypeInitialization`) as "oracle unavailable". ## Contract Overlay-only; **no `PROTOCOL_VERSION` bump** (`overlay.toml` unchanged). The only wire change is the removal of the additive `imaging` field from `assets.sources`; the website tolerates its absence (every read is guarded by `sources.imaging &&`, so `NO_IMAGING` simply never fires). The spec is updated in the paired docs PR. PNG bytes/sha256 for art change (new managed encoder, as in PR 1), so the site re-fetches on the next warm/force — expected. The now-dead `NO_IMAGING` UI/model in **module-uo**, the **installer** `doctor` libgdiplus row, and the **runicgateway.com** docs are each tracked in a follow-up issue in their own repo. ## Verification - `dotnet build` of the deployed tree: **0 warnings / 0 errors**. - **Merge gate** (`[BridgeArtParity]`, run headless): - **Windows** (vendored GDI+ oracle available): decode pass **43,433/43,433** matched (39,189 statics + 4,244 land), hue-33 pass **39,189/39,189** matched — `MISMATCHED 0 MISSED 0 EXTRA 0`. Every served picture is pixel-identical to the vendored decode. - **Linux/Mono** (WSL2 Ubuntu 24.04 / Mono 6.8 / libgdiplus 6.1, the live-host match): the vendored oracle throws `NotImplemented` (the #39 bug) and the managed path produced all 43,433 + 39,189. Paired with docs PR (`docs/asset-bridge-gdiplus-art`). Closes the art half of #39. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_014HJEmcaKvWQ8LsnXHKha5y
wtclaude added 1 commit 2026-11-26 02:14:30 -06:00
On a Linux/Mono shard the Asset Bridge's item and land art failed: the vendored
Art.LoadStatic/LoadLand build a 16bpp Bitmap (Settings.PixelFormat) and
libgdiplus 6.1 cannot create one, so every static and land picture threw
[GDI+ NotImplemented] before a pixel was read. PR 1 moved the body catalogue off
System.Drawing; this finishes the migration for the art plane, so Windows and
Linux now share one managed path and the whole Asset Bridge needs no libgdiplus.

- BridgeArtMul: a hand-written art.mul static + land decoder to ARGB1555,
  mirroring Art.LoadStatic's run loop and LoadLand's 44x44 diamond, with the
  record/canvas bounds the vendored writers lack (no System.Drawing, no Bitmap).
- BridgeArt: Render now decodes through BridgeArtMul and hues through BridgeHue
  (over hues.mul + the tiledata PartialHue flag) into BridgePng, via a shared
  TryArtPixels helper the parity harness drives. The GDI+ Bitmap/ApplyTo/dispose
  path, the imaging gate, and the Files.CacheData re-check in TryHue are gone,
  because a key now decodes its own fresh buffer that nothing else aliases.
- BridgeAssets: retire BitmapToPng (its last caller) and the imaging probe/field
  machinery; assets.sources no longer carries an imaging field. No decode goes
  through System.Drawing any more, so the NO_IMAGING refusal is retired with the
  GDI+ it guarded. Files.CacheData stays off, now only so the parity oracle's
  vendored decode hands back fresh bitmaps.
- BridgeArtParity: a [BridgeArtParity] GM command / BRIDGE_ART_PARITY=1 boot run
  that compares the managed decode+hue against the vendored one pixel for pixel.

Overlay-only; no wire change beyond the retired imaging field, no PROTOCOL_VERSION
bump. The website tolerates the field's absence (its NO_IMAGING branch is guarded
by `sources.imaging &&`); the dead NO_IMAGING UI/model in module-uo and the
installer doctor libgdiplus row are removed in a tracked follow-up.

Verified on this machine. Windows (vendored GDI+ oracle available): the parity
harness compared every served picture and every one is pixel-identical to the
vendored decode — 43,433/43,433 (39,189 statics + 4,244 land) with no hue, then
39,189/39,189 again hued in each item's PartialHue mode, 0 mismatched. On WSL2
Ubuntu 24.04 / Mono 6.8 / libgdiplus 6.1 (the live-host match) the vendored
oracle threw NotImplemented and the managed path produced all 43,433 + 39,189.
dotnet build 0/0.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014HJEmcaKvWQ8LsnXHKha5y
whitlocktech approved these changes 2026-11-26 02:23:14 -06:00
whitlocktech merged commit 01561683d1 into main 2026-11-26 02:23:19 -06:00
whitlocktech deleted branch fix/asset-bridge-gdiplus-art 2026-11-26 02:23:19 -06:00
Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: RunicGateway/servuo-plugins#43
No description provided.