Asset Bridge legacy-MUL art fails on Linux/Mono with [GDI+ NotImplemented] — finish the GDI+-free migration #39
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
On a Linux/Mono shard, the Asset Bridge's legacy-MUL image paths (the phase‑3 body
catalogue and phase‑5 item/land art) fail with
[GDI+ status: NotImplemented]. Thephase‑4 UOP animation path is unaffected. The result: the ~787 legacy
anim*.mulcatalogue sprites, and item/land art, do not render — so creature thumbnails and item art
partially break on the website (bestiary, marketplace, character sheets) when the shard
runs on Linux. On Windows every path works, which is why this surfaced only on the
Windows → Linux/Mono migration.
Installing or reinstalling libgdiplus does not fix it (confirmed on the live host):
this is not a loading problem. Mono finds
libgdiplus.so.0(6.1, the newest Ubuntu 24.04offers); the
NotImplementedis libgdiplus's own answer to a GDI+ operation that versiondoes not implement under Mono.
Root cause
The exact failing call is libgdiplus refusing to create a 16-bit bitmap, deep inside
ServUO's bundled
Ultima.*SDK — before any overlay code runs. The pinned trace (Monodetailed logging, 14,956 identical failures,
body 1 action 0…body 994 action 34):Ultima.Frame's constructor doesnew Bitmap(width, height, Settings.PixelFormat), andSettings.PixelFormatis 16-bit (Ultima/Settings.cs:10,12—Format16bppRgb555/Format16bppArgb1555;Ultima/Animations.cs:960). Every UO animation frame is created asa 16bpp image. libgdiplus on Linux cannot create 16bpp bitmaps and answers
NotImplementedfromGdipCreateBitmapFromScan0; Windows' own GDI implementation (whichMono-on-Windows calls) supports them, which is why it worked before the move. A different
libgdiplus build almost certainly will not help.
So the decode blows up inside the inherited SDK's
Framector, before the overlay evergets a
Bitmapto encode. The overlay's own code then has a second, independent GDI+dependency on the way back out (the encode/hue side), which the same migration must also
remove, but the decode is what fails first:
overlay/Scripts/Custom/Bridge/BridgeCatalog.cs:720-730:Animations.GetAnimation(...)← fails here → (would be)Frame[0].Bitmap→BridgeAssets.BitmapToPng(bitmap).overlay/Scripts/Custom/Bridge/BridgeArt.cs:426-449:Art.GetLand/Art.GetStatic→Hue.ApplyTo(bitmap, partial)→BridgeAssets.BitmapToPng(bitmap).Almost certainly the same 16bpp‑ctor failure (same SDK, same
Settings.PixelFormat),though the trace above is the animation path only.
overlay/Scripts/Custom/Bridge/BridgeAssets.cs:601-670(BitmapToPng):LockBits/UnlockBitsandBitmap.Save(ms, ImageFormat.Png)— also GDI+, also to be removed.The GDI+ dependency is inherited, not ours — and the escape path already exists in this
tree. The phase‑4 UOP work was written specifically to avoid libgdiplus (see the comment
in
BridgePng.cs:7-26andBridgeUop.cs, "libgdiplus was archived in March 2025"):BridgeUopdecodes the UOP container to aushort[]of ARGB1555 with "noBitmapanywhere", and
BridgePng.FromArgb1555encodes it. The legacy MUL path is simply the halfthat was never migrated —
BridgePng.cs:24-26says as much: "Phase 3'sBridgeCatalog.ToPngis left exactly as it is … a path that needs GDI+ to produce thepixels in the first place."
Why not just install a newer libgdiplus / use SkiaSharp or ImageSharp
24.04 packages, and a from‑source build is a guess (it may or may not implement the exact
op). Rejected as the primary fix.
app, but this plugin is deployed as source and compiled by ServUO at boot — there is no
NuGet/package restore (see
.claude/guides/servuo-plugins.md). SkiaSharp ships per‑OSnative libraries; ImageSharp is a managed DLL — either must be vendored into the overlay
and referenced by ServUO's boot compile, which is real friction for a source‑deployed
tree. Also note the stack is .NET Framework 4.8 under Mono, not .NET 7+, so
System.Drawing.Common's .NET‑7 non‑Windows removal does not apply here; the constraintis libgdiplus's
NotImplementedgaps, not the managed API being gone.Proposed fix
Finish the GDI+‑free migration the overlay already started, so Windows and Linux use the
same managed path rather than a Linux‑specific workaround:
Bitmapis created insideUltima.Frame/Animations.GetAnimation/Art.Get*, so no overlay‑side change can savethat call; it must not be invoked on Linux. Reimplement the legacy decode
(
anim*.mul/art.mul→ ARGB1555ushort[]) and hue application (hues.mul+tiledata.mulPartialHue, as documented inBridgeArt.cs) against the raw bytes, thesame way
BridgeUopreimplemented the UOP container — then encode with the existingBridgePng. NoSystem.Drawing, no new dependency.Ultima/Settings.csto a 32bpp format. A stock‑filepatch (via
patches/) changingSettings.PixelFormatto e.g.Format32bppArgbwould letlibgdiplus create the bitmap, but it ripples through all of
Frame's 16‑bit pixelread/write (
LockBitsstrides, the ARGB1555 packing) and every other SDK consumer, and itkeeps the whole path on GDI+ (the encode still calls
Save(Png)/LockBits). It trades aclean managed path for a fragile edit to inherited code — not preferred.
PROTOCOL_VERSIONbump; overlay‑only.design‑approved before coding — it is not a one‑liner like #37.
Evidence (live Linux/Mono shard, from an ops investigation)
mono ServUO.exe -releaseas userservuo;libgdiplus.so.0.0.0(6.1) isloaded via Mono's own
System.Drawing.dll. The[Bridge][GDI+ status: NotImplemented]errors appear here — 14,956 identical failures across
body 1 action 0…body 994 action 34during one catalogue import.runicgateway-link, userrunicgateway) is native and does notlink libgdiplus — it is not involved in image decode.
Bitmapconstructor inUltima.Frame(full trace in Root cause above).GdipCreateBitmapFromScan0→NotImplemented.Related findings (separate from this issue)
assets.bodiesMissingMethodException (new bug, worth its own issue). During the sameimport:
[Bridge] assets.bodies: greatape: MissingMethodException: Default constructor not found for type Server.Mobiles.GreatApe— same forNavrey,TribeChieftan,TribeShaman,TribeWarrior. The body→name path instantiates mobile types that have noparameterless constructor. Unrelated to GDI+; affects name resolution for those creatures.
/opt/servuoisdrwxr-x--- servuo servuo, so the sidecar'srunicgatewayuser cannot traverse/readDataPath.cfg,/opt/servuo/uo-dataorCliloc.enu. Harmless for the cliloc import (ServUO, asservuo, reads those and servesthem over the bridge — see #37), but a latent trap worth closing, and the pre‑Nov‑22
"Permission denied (os error 13)" sidecar‑log lines should be explained.
BridgeAssets.Failemits an
assets.errorJSON over the bridge (BridgeLink.Emit) and never writes to theconsole, so the cliloc NOT_FOUND text authored in
BridgeCliloctravels to the websiteand surfaces there, not on the shard. The ops finding of "0 cliloc lines on the ServUO
VM" is consistent with that and does not contradict #37.
deployment‑level asset tests under the real service identity would have caught this; worth
its own stream.