Added read support for image blobs#11
Open
yannickulrich wants to merge 5 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds support for the native image insertions in notebooks on 3.27 or later. I've opened similar PRs with the python reader (ricklupton/rmscene#52 and ricklupton/rmc#50). The construction is based on remarkable-shapes which already has this ability in ruby.
On the top-level, images are defined in a
ImageEntry(block type0x0E) via a UUID. They can have a flag which currently always evaluates to[17, 0]. They are then references in the tree as aImage(block type0x0F, item type0x07). This uses the UUID defined earlier and includes image placement as a list of image vertices (x, y, u, v tuples)Exporting images is (in principle) pretty easy
However, there is a question of how to load the image in the first place. An rmdoc file looks like
Since the reader is just given a file handle for the
.rmfile, it won't be able to figure out how to load the.pngfiles next to it. If you have a suggestion on how to best handle this, please let me know!