if the html is an image tag and there's a file that was made available by whoever put it on the clipboard, then most probably the file is the content of that image, and thus the CKEditor should favor the fileupload.
Anca Luca as you can see, the fact that the DataTransfer has both an image and some HTML (with an image tag) doesn't mean the user intent was to paste the image. Even if the user has copied a table from an Excel document or some part of a PowerPoint presentation, the HTML put in the clipboard may have an image tag (e.g. an icon in one of the Excel table cells or presentation slides). Checking that the image tag present in the copied HTML points to the same image found in the clipboard (DataTransfer object) is not easy. The image source may be a URL in the HTML so we'd have to fetch that URL and compare with the image from the clipboard.
I'm wondering if it's not better to allow the user to choose the type of paste when we detect that the DataTransfer object has multiple types. WDYT?
This message was sent by Atlassian Jira (v9.3.0#930000-sha1:287aeb6)
If image attachments aren't displayed, see this article.