Embed raster images in the SVG preview

The SVG preview painted every DisplayItem::Image as a grey rectangle. Encode
the raw RGB image as a PNG (zlib via flate2, CRC32, base64) and emit an SVG
<image> data URI; keep the grey fallback for images above four megapixels.

The article preview now contains the real 480x240 plot and the framed rule
figure is visible while editing. Test count stays 1074.
This commit is contained in:
gloamxun committed 2026-10-27 23:50:48 +08:00
1 parent fc328a56c6
commit 2ef5e29329
4 files changed
+107 -11

No files matched your search

+1 -1
View File
@@ -49,7 +49,7 @@ now means route-D.
| Article/report basics: title, sections, lists, TOC, page numbers | Supported | corpus and 1074-test suite |
| Inline/display math, equations, tags, cleveref | Supported | math tests, oracle fixtures |
| Floats, captions, tables, booktabs | Supported | table/math tests, corpus |
| PNG/JPEG/BMP `\includegraphics` | Supported | project image tests; PDF XObjects now use pixel dimensions and embed the raster |
| PNG/JPEG/BMP `\includegraphics` | Supported | project image tests; PDF XObjects use pixel dimensions and the SVG preview embeds a PNG data URI |
| PDF/SVG/EPS figures | **Not supported** | undecodable images become placeholder rules |
| Inline `thebibliography` + `\cite` | Supported | numeric or custom labels; citation tests |
| `.bib` + BibTeX data | Partial | simple `@article`/`@inproceedings` fields are inlined as labeled `thebibliography`; project citations use author-year labels (`Kour and Saabne, 2014a`) |