Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support images in libraries #5034

Open
3 tasks
dwelle opened this issue Apr 13, 2022 · 9 comments
Open
3 tasks

support images in libraries #5034

dwelle opened this issue Apr 13, 2022 · 9 comments
Labels
enhancement New feature or request

Comments

@dwelle
Copy link
Member

dwelle commented Apr 13, 2022

  • library schema update
  • investigate sanitization requirements
  • encoding?
@dwelle dwelle added the enhancement New feature or request label Apr 13, 2022
@dwelle
Copy link
Member Author

dwelle commented Apr 13, 2022

I'm not super happy about encoding the images as base64 into the JSON library file.

Alternatives are keeping the files separate from the .excalidrawlib and zipping them into a single binary, or binary encoding the whole excalidrawlib file itself.

I wanted to investigate publishing two lib files anyway. One would be JSON .excalidrawlib and another would be .excalidrawlib.bin which would be the file we actually install from. Though one could make the argument that keeping the JSON file around would be redundant at that point.

@vramiro
Copy link

vramiro commented Apr 28, 2022

Hello @dwelle

I was just wondering if the support for SVG files in the library would be on this same issue or if a new one is needed.

@dwelle
Copy link
Member Author

dwelle commented Apr 28, 2022

@vramiro SVGs for under this issue, yes

@rockssk
Copy link

rockssk commented Sep 28, 2022

Hi @dwelle

Just checking in to see if there is any progress on this item, Community will hugely benefit from adding images to the library, we have tools that can generate line drawn version of an icon, but publishing it as Excalidraw library is still an issue.

@tylernix
Copy link

Hi @dwelle

Any update on this? This is blocking me from using Excalidraw+ for my whole team for our virtual whiteboarding use case. We have a set of architectural icons (png & SVG) that we use during each whiteboard session and would really be helpful to add these to a personal library to reuse them.

@public-rant
Copy link

public-rant commented Dec 18, 2022

Long time user, first time poster.

I find myself both in need of this feature, as well as the time to work on it.

I realise this maybe isn't the best "good first issue" so please fogive me if I'm talking out of school.


By "Investigate sanitisation requirements" are you hoping to guard against this sort of thing?

Regarding the implementation, would the intention be to use imageCache to create a zip file containing the scene data of the (selected?) elements, along with the associated image files?

I'm guessing the existing functionality - encoded images as dataURLs before adding them to the scene, etc. - could be left as it is while extending the library feature to allow for including images by refactoring the library feature to create a zip file (instead of JSON/excalidrawlib) using the imageCache as the source.

/cc @dwelle

@dwelle
Copy link
Member Author

dwelle commented Dec 19, 2022

By "Investigate sanitisation requirements" are you hoping to guard against this sort of thing?

Yes.

Regarding the implementation, would the intention be to use imageCache to create a zip file containing the scene data of the (selected?) elements, along with the associated image files?

I'm guessing the existing functionality - encoded images as dataURLs before adding them to the scene, etc. - could be left as it is while extending the library feature to allow for including images by refactoring the library feature to create a zip file (instead of JSON/excalidrawlib) using the imageCache as the source.

The zip suggestion was mainly about use case, not implementation.

That said, it needs to account for all sorts of persistence models: browser (also moving from LS to IDB), library repository (database), filesystem (on export), host apps (make it extensible).

It's pretty much the same with canvas images, but the difference is that handling images separately is pretty annoying — as it already is with canvas images today. But with libraries, it'd be more so.

@inwardmovement
Copy link
Contributor

inwardmovement commented Oct 22, 2023

Wouldn't it be "easy" to support SVGs in libraries, as they are "just code"?

@dtonda
Copy link

dtonda commented Jul 11, 2024

Support for SVG would be really appreciated as it's the best way to include product icons and architecture diagram examples in the libraries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

7 participants