The target "image/jpeg" is not respected when reading from the X11 clipboard
Categories
(Core :: Widget: Gtk, defect, P3)
Tracking
()
People
(Reporter: awalgarg, Unassigned)
References
(Blocks 1 open bug)
Details
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/110.0
Steps to reproduce:
- Place any jpeg file on the X11 selection clipboard.
- Example:
xclip -selection clipboard -target image/jpeg /path/to/file.jpeg
. - Verify that another application is able to read it.
- Example:
xclip -out -selection clipboard | feh -
, displays the copied image. xclip -out -selection clipboard -target TARGETS
, showsimage/jpeg
.- Paste it in an input element in firefox and inspect the
ClipboardEvent
consequently dispatched. - Repeat, but this time, place the same file on the clipboard with the target
image/png
instead.
Brief code to reproduce:
<!DOCTYPE html>
<input id="i">
<script>
document.getElementById('i').addEventListener('paste', e => {
console.log(e.clipboardData.files.length);
});
Platform: Linux xxx 6.1.18-1-lts #1 SMP PREEMPT_DYNAMIC Sat, 11 Mar 2023 14:39:23 +0000 x86_64 GNU/Linux (Arch linux)
Actual results:
- When the file is placed with target
image/jpeg
, clipboardData.files is empty. - When the file is placed with target
image/png
, clipboardData.files shows a file. It is displayed correctly on the webpage as such:document.body.appendChild(new Image(URL.createObjectURL(clipboardData.files[0])));
Expected results:
The clipboard target image/jpeg
should be respected.
Comment 1•2 years ago
|
||
I can reproduce this Ubuntu22.04 LTS.
CTRL-V to paste works fine with "xclip -target image/png *" even though the image is in jpeg but not with "image/jpeg" nor with "image/jpg".
The link here demonstrate this bug on chromium, and the issues is exactly the same for firefox.
Comment 2•1 year ago
|
||
Setting the component so that the developer can have a look over this.
If this is not the correct component, please feel free to change it to a more appropriate one.
Updated•1 year ago
|
Description
•