-
Hi everyone, I come from this issue #3737, and specifically this comment #3737 (comment), as advised by @ad1992. Here's the comment, verbatim. @ad1992 Hello again, I have a question again on this scene embedding. I'd like to do that programmatically. However I can't seem to get excalidraw embed the scene when calling
I also tried to pass the excalidraw/src/scene/export.ts Lines 68 to 134 in 5cd9215 I believe |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
@bric3 thanks for pointing this out, yes you are right now the utils which are exported |
Beta Was this translation helpful? Give feedback.
-
@ad1992 Hi ! I noticed quite a few image types in a recent version of Excalidraw (16), I know there's 17 already. export declare const IMAGE_MIME_TYPES: {
readonly svg: "image/svg+xml";
readonly png: "image/png";
readonly jpg: "image/jpeg";
readonly gif: "image/gif";
readonly webp: "image/webp";
readonly bmp: "image/bmp";
readonly ico: "image/x-icon";
readonly avif: "image/avif";
readonly jfif: "image/jfif";
}; But I was wondering if embedding the scene was supported in some of those types (apart from PNG and SVG of course). I have doubt on the technical feasibility or practicality for bmp, gifs, icons, but for the others the question remains. If I'm asking that, is that, if it is supported, or planed to be supported, I would like a documentation of how the scene is embedded. Because I need a way to detect the presence of scene in those binary file in another runtime (JVM based as it's for IntelliJ). |
Beta Was this translation helpful? Give feedback.
@bric3 thanks for pointing this out, yes you are right now the utils which are exported
exportToSvg
,exportToPng
do not support embedding the scene.If you notice it expects a
metadata
attribute, whatever is send inmetadata
will be embedded in the SVG/PNG.The way it works in
excalidraw
is we send themetadata
as shown here. We will add this support soon but till then as a workaround, if you are blocked at this you will have to passmetadata
so that scene is embedded.You can clone encodeSvgMetadata and encodePngMetadata to get the metadata and pass it to the export utilites.