| 1 | # Rust picture authoring |
| 2 | |
| 3 | `inserted/candidate` is the page writer's output for |
| 4 | `a_picture_inserted_on_a_fresh_page_reads_back_and_can_be_removed` in |
| 5 | `crates/onestore/tests/page_images.rs`: on a section created in Rust, a |
| 6 | paragraph between two text paragraphs becomes a picture, stored the way |
| 7 | OneNote stores an inserted picture (`corpus/native/cold-05-05-image`): the |
| 8 | PNG embedded in the section's file-data store list as a file-data store |
| 9 | object, a picture-container file object declaring it by identity and |
| 10 | extension, and a picture object with the displayed size that the paragraph |
| 11 | holds as content. OneNote's own picture objects also carry a DPAPI-protected |
| 12 | blob (`0x1c001dfb`) that only the authoring Windows user can decrypt; the |
| 13 | writer omits it. `inserted/cold` is a fresh OneNote 2010 read: the image |
| 14 | reads back as `format="png"` with the exact payload bytes, between the two |
| 15 | text paragraphs. |
| 16 | |
| 17 | `native-resize` is OneNote 2010 editing that Rust-written picture |
| 18 | (`tools/native/picture-edit.ps1` on `inserted/candidate`): the picture gets |
| 19 | a 144 by 108 point user-set size and alternative text through the COM API |
| 20 | (`before.xml`, `update.xml`), and `read/` is the read after the edit. In |
| 21 | `notebook/`, OneNote stored the size as the picture object's layout width |
| 22 | and height with the user flag (`0x14001c1b`, `0x14001c1c`, `0x08001cbd`) and |
| 23 | left the intrinsic size (`0x140034cd/ce`) alone; it also rewrote the picture |
| 24 | container under a native identity with its DPAPI blob and hash. |
| 25 | |
| 26 | `resized/candidate` is the writer doing the same on the native picture of |
| 27 | `cold-05-05-image` (`a_native_picture_is_resized_and_described_then_reset`): |
| 28 | layout width, height, user flag and alternative text on the picture object. |
| 29 | `resized/cold` is its cold read with the size and description. |
| 30 | |
| 31 | `native-page-level` is OneNote 2010 placing a second picture directly on |
| 32 | the page of `inserted/candidate` through the COM API |
| 33 | (`tools/native/page-picture.ps1`): the picture object is a direct page |
| 34 | child with a position, a user-set size and alternative text, otherwise |
| 35 | stored like a paragraph picture. `page-level/candidate` is the writer doing |
| 36 | the same on a fresh section (`a_page_level_picture_is_inserted_moved_and_removed`) |
| 37 | and `page-level/cold` its cold read with position, size and description. |
| 38 | |
| 39 | `tools/test_picture_edit.py` checks all five without a VM. Regenerate the |
| 40 | candidates with `ONESTORE_IMAGE_EXPORT`, `ONESTORE_IMAGE_RESIZE_EXPORT` and |
| 41 | `ONESTORE_PAGE_IMAGE_EXPORT` set to new absolute directories while running |
| 42 | the tests, then cold-open them with `tools/native_runner.py OUTPUT COLD |
| 43 | --expected-pages 1 --collect-notebook`; regenerate `native-resize` and |
| 44 | `native-page-level` with `--author tools/native/picture-edit.ps1` or |
| 45 | `tools/native/page-picture.ps1` on `inserted/candidate`. |