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

feat: UI Options: Disable "image" shape #5133

Conversation

cynicaloptimist
Copy link

Implements #4831, paving the way for more support for #3012.

I'm sure I've overlooked a few other places that the new option should be checked. There might be some data-paste code path that needs to consider this?

I called the prop shapeActions but tools would make sense too as described in the linked issue.

@vercel
Copy link

vercel bot commented May 1, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
excalidraw ✅ Ready (Inspect) Visit Preview May 20, 2022 at 7:43AM (UTC)
excalidraw-package-example ✅ Ready (Inspect) Visit Preview May 20, 2022 at 7:43AM (UTC)

@dwelle
Copy link
Member

dwelle commented May 16, 2022

What should happen if user imports a file that contains images?

@cynicaloptimist
Copy link
Author

Good question. The major use case for this option is when I don't want to provide binary image storage for my users' Excalidraw drawings, so it wouldn't make sense to let them add images via import since they'd just break on page reload.

I suppose it should remove the images from the file at import time, any maybe display a warning? What's your opinion?

@eMerzh
Copy link

eMerzh commented May 19, 2022

thanks @cynicaloptimist for this PR ... i have the exact same need (i'm stuck in 0.10 for that... and start to experience issue with it).

IMHO uploading a file with image should ignore those.... as you stated we don't want the images in the end results

@cynicaloptimist
Copy link
Author

cynicaloptimist commented May 22, 2022

@dwelle I handled the paste and drag cases as you mentioned on Discord. Not sure about the best approach for removing images from an imported drawing. I could add an optional parameter to restore() from restore.ts to filter out image elements there, for instance. Other ideas?

@dwelle
Copy link
Member

dwelle commented Mar 26, 2023

Hi @cynicaloptimist. I'm really sorry for dropping this one — to the extent that I forgot it exists and on one evening made almost a duplicate PR https://github.com/excalidraw/excalidraw/pull/6320/files 😭.

In my PR I'm handling a bit more cases. And we also need to handle the importing case as you mention above.

If you still want to work on this, then I'd suggest you pull some of the changes I'm doing in my PR (mainly the app.tsx drag&drop and blob related things including error handling) into this one.

But it's fine if you want to move on, in which case I'll likely close this PR and wrap it up in my own.

Let me know your thoughts!

@cynicaloptimist
Copy link
Author

Thanks for the response- I don't remember enough context to pick this back up so feel free to close the PR. 👍

@dwelle dwelle closed this Nov 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants