News for hackers. Stuff that matters.
Re:How the Clipboard Works by enriquto on Tuesday October 25, 2022 @04:11AM (#33327612)
I understand this concern. But it seems that it would be better to have an orthogonal implementation of this. The clipboard remains text-only. If you select an image or a file, it copies its absolute path (or url) into the clipboard. Then it is the responsibility of the destination program to interpret what to do with this text. If you paste the filename of an image into a plain text editor, you'll get the filename verbatim. If you paste it into an image editor, it opens and pastes the image in there. But from the point of view of the clipboard it's always just text (maybe with some textual markers).
Re:How the Clipboard Works by jakub_jo on Tuesday October 25, 2022 @04:23AM (#33327717)
Or better: The data URI gets copied.
Re:How the Clipboard Works by ubercow13 on Tuesday October 25, 2022 @04:53AM (#33327949)
But I already downloaded the image, I don't want to download it again. What if I want to copy a subsection of an image from an image editor, there is no textual representation as it is not a file on disk.
Re:How the Clipboard Works by NavinF on Tuesday October 25, 2022 @06:40AM (#33328713)
That breaks common use cases such as copy-pasting private images that can only be downloaded using your login cookies.

> If you paste the filename of an image into a plain text editor, you'll get the filename verbatim. If you paste it into an image editor, it opens and pastes the image in there

That's how the clipboard already works on Windows as long as the source application provides both formats.