Repository navigation
Excalidraw 2.3.0: image options, rename conversion, new image files - #80
Merged
Merged
Conversation
Brings image editing to parity with the Excalidraw VS Code extension (https://github.com/excalidraw/excalidraw-vscode#edit-images): - "Picture in this file" in the main menu sets an image's scale, background and dark mode, per file; new images start with the last look picked. VS Code only has one global setting. - A PNG notes its look in an `orca-excalidraw-look` tEXt chunk after the scene, so it reopens exactly; Excalidraw ignores it. - Renaming .excalidraw to .excalidraw.svg/.png, or .svg to .png, opens the scene, draws the picture (tab turns dirty) and saves the new format. - "New Excalidraw SVG image" and "New Excalidraw PNG image".
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.
What changed
Follow-up to #79 (issue #77). This brings image editing up to the Excalidraw VS Code extension's "Edit Images" feature, and goes further in places.
.excalidraw.svg/.png.excalidraw↔.excalidraw.svg/.pngto convert.excalidraw→ svg/png, and svg → pnglocalStorage, the same place as the library, and new or converted pictures start with it. I used the menu instead of an Orca setting so the plugin doesn't need a new capability (settings:own), which would make every user approve the plugin again.tEXtchunk,orca-excalidraw-look, holds{scale, background, dark}. It sits after the scene chunk, and Excalidraw reads only the firsttEXt. With it, reopening no longer depends on guessing from pixels. Excalidraw's own PNG exports still use the pixel check, and the menu can now correct a wrong guess.image: null, stale: true.picture-syncdraws it on attach, so the tab turns dirty and the next save writes the new format. An SVG renamed to PNG keeps its look.README.mdandbuild/README.md. Catalog 2.3.0 entry generated withscripts/release-entry.mjs --write.Verification
npm test: 26/26 pass. New tests cover rename decoding (JSON→svg, JSON→png, svg→png with its look), drawing on attach and saving the converted file, the PNG look chunk round trip (Excalidraw's first-tEXtreader still finds the scene), and a look surviving a merge.node build.mjs: rebuilteditor/.editor/with a fake Orca document session: 14/14 checks pass. Covered:.svgand to.pngis drawn and embedded.orca plugin validateandorca plugin check: valid. The only warnings are the same 4editor_evalwarnings (from bundled Excalidraw code) as onmain.ORCA_DIR=<orca@81ec82b> node scripts/release-entry.mjs: ok.scripts/check-catalog.mjs:catalog: ok.Execution profile (for anything above
data, say why it is needed)sandboxed-ui, the same as 2.2.0. It adds no capabilities, permissions or network access.🤖 Generated with Claude Code