Open JohnMcLear opened 2 years ago
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.
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.
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)
@webzwo0i yikes.
https://github.com/citizenos/ep_image_upload/pull/56 tries to solve this. Any feedback welcome
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.