benwinding / quill-image-compress

A Quill rich text editor Module which compresses images uploaded to the editor
https://benwinding.github.io/quill-image-compress/src/demo.html
MIT License
123 stars 30 forks source link

Fixes double handling issue (Issue #51) #54

Closed enzedonline closed 4 weeks ago

enzedonline commented 3 months ago

When drag/drop or copy/paste from file system, the image is added twice to the editor - one original, one compressed. This was the behaviour originally reported in #51

It's replicated in the code pen here.

Oddly doesn't occur when running in the dev server.

Updated ImageDrop so that drop and paste event listeners are registered with useCapture=true, event.stopPropgation called to stop event bubbling in the following places:

Tested and confirmed on Windows. Probably needs double checking on Mac (and Linux??) - sorry, no access to either myself.

Also:

bacinet02 commented 2 months ago

Hello, I can test on Linux. But I have not enough skills to build quill.imageCompressor.min.js :-(

enzedonline commented 2 months ago

@bacinet02 no problem, you can download the compiled JS for this PR here

ThomasTJdev commented 2 months ago

Thanks for this PR @enzedonline . Using it on Win, Linux and Mac.

bacinet02 commented 2 months ago

Thanks for the PR @enzedonline . I have tested on Linux with firefox. But it doesn't works... Before, when I pasted an image, the image was doubled in the editor. Now, when I past an image, NO image appears in the editor.

Here is the configuration of the module:

modules: {
  imageCompressor: {
   quality: 0.75,
   maxWidth: 1200,
   maxHeight: 1200,
   imageType: 'image/jpeg',
   debug: true,
   suppressErrorLogging: false,
   handleOnPaste: true, 
   insertIntoEditor: undefined,
  }, 
  ...
}

And here is the log (firefox console):

</> quill-image-compress:  drop fired 
drop { target: div.ql-editor, buttons: 0, clientX: 111, clientY: 328, layerX: 110, layerY: 37 }
quill.imageCompressor.min.js:1:14381
</> quill-image-compress:  handleDrop 
Object { evt: drop }
quill.imageCompressor.min.js:1:14689
</> quill-image-compress:  handleDrop found files 
Object { evt: drop, files: FileList(1), imageFiles: (1) […] }
quill.imageCompressor.min.js:1:14874
</> quill-image-compress:      pasteFilesIntoQuill pasting 1 images... quill.imageCompressor.min.js:1:16641
</> quill-image-compress:      pasteFilesIntoQuill pasting image (0) quill.imageCompressor.min.js:1:16914
</> quill-image-compress:  onImageDrop 
Object {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nZlvQuWqHEsj6osWI921uOss4+QNW+EcchxdIqu21q6XETYd4s0aTTSXzjrslYm5ACinW6Ws+tqaVZNRFeq093TJKfH9q11HOAsYyelWdRPUhtmwg7cx6wqx7fWbXspeZpILG0WlQ3MOvyYxttrAhZeSRr73B+RNVb8XSNa/c/3AcyKdXL9ublYapSpe1ttuVb0132W0+NSlOVvFvHtmkYsdxttW/7R3tH8rM594wdTzfb+cY5kgUyg9dRPKxaqjK3H4wpEutA3oaRyQYjfK8nDiofHFM4hLPqkA6WWDT/9JmHD1rlzat//lh6qMTOnr77d8EXfga1rKyVt9bMuS9UK9+Yclhge0rT/hX8KessOFST+I7N2B4WRKxTidnRSbVLejs/TjdF7qA4nhx0iB+yamMW+ajY3n6/mV8vvF+9PA1Kx6t8UmzGPW4m+WqpOqs2gcQ69yr2bBvjL9UMKkcVX2jtDwsn1i9ALGIRawixBIglwB+wFeDMEvnzQv7+3b/or8AfKAcAAAAAAAAAAAAAAAA+j38ArZxwdcjDpiEAAAAASUVORK5CYII=" }
quill.imageCompressor.min.js:1:9393
</> quill-image-compress:      pasteFilesIntoQuill done quill.imageCompressor.min.js:1:17049
</> quill-image-compress:  downscaling image... 
Object { args: {…}, newHeight: 168, newWidth: 300 }
quill.imageCompressor.min.js:1:3384
</> quill-image-compress:  downscaleImageFromUrl 
Object { dataUrl: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAACoCAMAAABt9SM9AAAAk1BMVEUFCjD33x4AAAAAADDw2R9lXSspKC7/6B0yMC//5h354R7eyBtVTQr95B/WwRrArRdeVQvjzRyShBKbjBNlWwzNuRmEdxDo0Ry3pRaWiBJHQAmwnxWNgBE9NwdqYA0iHwR1ag43MgellRQZFwNWTgpKQwkSEAPGsxh7bw8rJwUeGwMkIAQxLQaomBR4bA5qXw0REy9tQCKkAAAD+ElEQVR4nO3df1PiOByA8W3tXbZZQkGggAoqiric7t77f3VHS38kberMd26HvTPP5z9KZMZnSjcNYf3yBQAAAAAAAAA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0GvN4cq+2zSpU/mUn97Rrily0UjhaKKK/QDzQooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKAPpf4Zf8k40X/rm/wD6Meusr4+EjqMCRwPQMRR5sv8Az1k/77NfHYnhR1q06vtrczb+Hu79zujjOWKVj7Bor4+82X/nrJ/32aPNl/56yf8AfZrH/U5/8/v/ACX/AO2H9e/un2DS8+tfHvmy/wDPWT/vs0ebL/z1k/77NH+pz/5/f+S//bB9e/un2DRXx95sv/PWT/vs0ebL/wA9ZP8Avs0f6nP/AJ/f+S//AGwfXv7p9g0vNfHvmy/89ZP++zR5sv8Az1k/77NH+pz/AOf3/kv/ANsH17+6fYXPrSV8febL/wA9ZP8Avs0ebL/z1k/77NH+pz/5/f8Akv8A9sH17+6fYNfO3xe/5KHc/wDXvD/6DXD+bL/z1k/77NISWOWJJ9Sc16eU5B/Z9d1vac2lrWt2832Mq2J9pHlsJRRRX0hyhRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQB//2Q==" }
quill.imageCompressor.min.js:1:11429
</> quill-image-compress:  insertToEditor 
Object { url: "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCACoASwDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAA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2J9pHlsJRRRX0hyhRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQB//2Q==" }
quill.imageCompressor.min.js:1:11641

Thanks for help

enzedonline commented 1 month ago

@bacinet02 hi, sorry, just saw this

Did it definitely work on previous versions with Firefox? It's never worked on Windows/Firefox. I didn't attempt to address that with this PR.

enzedonline commented 1 month ago

Odd ... now I've just re-tested on Firefox, it works exactly as it should for me (Windows).

I fired up a virtual Ubuntu and it seems to work for me there as well:

  1. copy file from Ubuntu Files app, paste into Quill
  2. drag from Ubuntu Files app, drop into Quill
  3. insert image with Quill image button
  4. copy/paste image with text as HTML
  5. copy image file from browser, paste into Quill

https://github.com/user-attachments/assets/d401925a-de8b-42cf-be8e-11b550de323b

bacinet02 commented 1 month ago

Hello,

due to hollydays, I will test in few days only... But thanks for the work :-)

benwinding commented 4 weeks ago

Tested and LGTM 👌 apologies for the delay 🙏 Thanks @enzedonline for contributing and making a codepen link replicating the issue! Will merge in and deploy