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

ctrl v of an image should create a new file if filesystem is being used #55

Open
JohnMcLear opened this issue Sep 1, 2021 · 5 comments
Labels
enhancement New feature or request

Comments

@JohnMcLear
Copy link
Collaborator

If "set to write to filesystem" is enabled ctrl v of an image should create a new file not write base64 to the pad.

I'd guess we'd need to catch paste events and if it includes an image do an upload to the filesystem instead of writing the contents to the pad.

@JohnMcLear JohnMcLear added the enhancement New feature or request label Sep 1, 2021
@rhansen
Copy link
Contributor

rhansen commented Sep 1, 2021

I think the right place to fix this is in the collectContentImage hook: If lineAttributes.img is a URL that does not match the expected form then upload the image (like the toolbar button does) and use the resulting URL instead. One problem with this approach: Like many client-side hooks, the collectContentImage hook is executed synchronously. We need to change Etherpad core to execute it asynchronously.

@alexeisenhart
Copy link

Is there any way to disable CTRL+V until this issue is resolved? Pasting images is the only way that my team is inserting images at this point, but disabling the feature and forcing them to upload an image file would help them avoid shooting themselves in the foot.

@webzwo0i
Copy link

Another problem: Pasting does not respect the maxFileSize limitation, so it's possible to insert arbitrary long images, regardless of the limit. (Only limited by Socket.io's max http buffer setting)

@JohnMcLear
Copy link
Collaborator Author

JohnMcLear commented Sep 29, 2021

@webzwo0i yikes.

@webzwo0i
Copy link

#56 tries to solve this. Any feedback welcome

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

4 participants