PNG and SVG export skip a reference image that is not decoded yet #91

Open
opened 2026-10-13 02:28:05 +00:00 by ImBenji · 0 comments
Owner

From the engineering review on 2026-10-13.

lib/rendering/components/canvas_objects.dart:229 does if (decoded == null) continue;. lib/rendering/export/pdf.dart:158 awaits ensureDecoded for each reference image first; png.dart and svg.dart do not (SVG only preloads glyphs).

Scenario: an image that is not in the decode cache at export time, for example right after load or import. SVG omits it. PNG paints per tile with awaits in between, so the decode can land mid-export and the image would appear only from some tile onward, cut at a tile boundary. That is another candidate for #56.

Evidence: test/review_probes/render_export_undecoded_image_probe.dart (local, untracked): the first export-style paint draws nothing, a later one draws the image. The sliced PNG consequence is inferred.

Fix sketch: await ReferenceImageDecodeCache.ensureDecoded for every exported image in PNG and SVG as PDF does, and preload GlyphDecodeCache in png.dart too. Related: #55.

From the engineering review on 2026-10-13. `lib/rendering/components/canvas_objects.dart:229` does `if (decoded == null) continue;`. `lib/rendering/export/pdf.dart:158` awaits `ensureDecoded` for each reference image first; `png.dart` and `svg.dart` do not (SVG only preloads glyphs). **Scenario:** an image that is not in the decode cache at export time, for example right after load or import. SVG omits it. PNG paints per tile with awaits in between, so the decode can land mid-export and the image would appear only from some tile onward, cut at a tile boundary. That is another candidate for #56. **Evidence:** `test/review_probes/render_export_undecoded_image_probe.dart` (local, untracked): the first export-style paint draws nothing, a later one draws the image. The sliced PNG consequence is inferred. **Fix sketch:** await `ReferenceImageDecodeCache.ensureDecoded` for every exported image in PNG and SVG as PDF does, and preload `GlyphDecodeCache` in `png.dart` too. Related: #55.
ImBenji added the bugarea:rendering labels 2026-10-13 02:28:05 +00:00
ImBenji added this to the Arcs & Angles project 2026-10-13 02:28:05 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: IMBENJI.NET/Metro-Map-Maker#91