Repository navigation
Add static pictures inside cells with XLSX roundtrip - #105
Conversation
|
Thank you — this is a substantial, well-hardened piece of work (read limits, pixel caps, decode limits, bounded texture cache). Two things before we can merge: (1) richdata failures are fatal: If you haven't already, please come join us on Discord: https://discord.gg/artcraft — happy to talk any of this through there. |
4c6e1be to
9dc3aaf
Compare
|
Landed — thank you, Harrison! Both review points are addressed nicely: pictures live in a sheet-level side map, and unreadable rich-data now warns and keeps the scalar fallbacks. I rebased it onto main myself (it conflicted with #83, #98 and main's restructured ROADMAP, where I kept main's version). Two small follow-up ideas if you're interested: the UI texture cache is keyed by If you haven't already, please come join us on Discord: https://discord.gg/artcraft |
Pictures can currently only float over a worksheet. This adds Insert → Pictures → Place in Cell for PNG/JPEG files. Pictures fit their current cell rectangles, follow sorting and structural edits, survive internal copy/paste and undo, and render in PDF exports. Existing floating pictures retain Place over Cells.
The review revision stores pictures in a sparse
Sheet::cell_picturesmap with shared immutable payloads; ordinaryCelllayout is unchanged. Content replacement removes the corresponding picture, while copy, cut, fill, sort, row/column edits and undo transport it explicitly. Cut uses the live source if it changes after the cut command.Optional XLSX picture-data failures now warn and preserve scalar fallbacks instead of preventing the workbook from opening, including oversized metadata, excessive rich records and relationship read errors. XLSX export keeps picture value metadata and dynamic-array metadata independent in the same package. The UI cache preserves more than 128 visible small pictures across frames, with bounded texture memory and admission before decoding under pressure.
Rebased onto main
c5bf34d. ODS/XLSB import changes are not merged there yet;Package::read_limitednow matches the incoming XLSB implementation so the two features can share it.Addresses #61 as an initial static-picture implementation. OS clipboard images, conversion between floating/cell pictures,
IMAGE()and rich-value formula propagation remain follow-up work. Scalar references and text exports use#VALUE!; please keep the issue open for the remaining scope.Validation:
cargo xtask cistops at the pre-existingcore/src/date.rs:108Clippy lint. Scoped checks report existing lints inengine/src/cmd/file.rs:51,xlsx/src/sheet_read.rs:146, and the UI formula bar/grid; no lint suppressions were added.Excel runtime and actual native/browser picker interaction are unverified. No external workbook or image asset is committed; tests generate original image data in code.