When it comes to copying images in a browser like chrome, there are two methods available: copying the image itself and copying the address of the image.
If I copy the image address and paste it using my Paste Image button, I can successfully retrieve the base64 version of the image. However, simply copying the image does not yield the same result. Is there a way to extract the image by using the image copier, as demonstrated in the examples?
Code:
clickPaste() {
let self = this;
(navigator as any).clipboard.readText().then(clipboard => self.clip = clipboard);
console.log(self.clip) // copied image address ---> base64
}
Example of Copying Image Address - Functional https://i.sstatic.net/ECi2V.png
https://i.sstatic.net/lAjUs.png
Example of Copying Image - Not Functional
https://i.sstatic.net/tM8DM.png
https://i.sstatic.net/ETTz2.png
While I understand that copying an image and copying its address are distinct actions, I am struggling to figure out how to acquire the image (either as a blob or base64) when opting for the image copy method.