-
-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't paste images into chat #79
Comments
Hi @emyller. Normally, if I copy the path from my file manager, it works. Could you tell me how do you copy and what you get when you paste it to another text area i.e. your browser's search bar? |
Hi, I found this issue when I experienced this problem. Another example is when copying an image displayed in the web browser (like this one) via the right click->copy image, and trying to paste it in whatsapp-for-linux. Normally, a text field shouldn't display anything when pasting this img copied contents, but if it supports images (as whatsapp web), it should load the image. Anyway, sometimes (I don't remember exactly where) when pasting the image in a text field, a base64 encoding of the image may appear. |
@vfmatzkin Thanks a lot, makes sense. So, it doesn't work with the images copied into memory I guess, not with image paths. |
@eneshecan Sorry, I forgot to reply to your first message. |
Any updates on this? I need this feature frequently and end up opening it on my browser far too much. |
Any prediction of when this feature will come? |
Unfortunately not soon as I am not fully available until the end of June. Sorry for the inconvenience... I think it requires a bit of work involving handling some clipboard data in webkit2gtk but I didn't have a chance to look closely. If someone tries to do it, I can review and merge. |
Here I tried to do this in a separate branch, yet without success. https://github.com/eneshecan/whatsapp-for-linux/tree/feature/paste_image_buffer. Any help is appreciated. |
I just tried the following JavaScript code in both WhatsApp-for-Linux and Firefox: document.onpaste = function (event) {
console.log(event);
var items = (event.clipboardData || event.originalEvent.clipboardData).items;
for (var index in items) {
var item = items[index];
if (item.kind === 'file') {
var blob = item.getAsFile();
var reader = new FileReader();
reader.onload = function (event) {
console.log(event.target.result);
};
reader.readAsDataURL(blob);
} else {
console.log(item);
}
}
}; When pasting an image in Firefox, the Apparently, that is the event WhatsApp Web uses to get a pasted image. EDIT: Epiphany also doesn't support this. |
Relevant issue from Tangram: sonnyp/Tangram#103. Apparently this needs to be fixed by WebKit then? |
Related to this issue, I also want to add that it seems like copying image from WhatsApp for Linux doesn't seem to work. I tried copying an image from WhatsApp for Linux and pasting it to other chat apps (Telegram, Slack), doesn't work. I can confirm that I'm able to do this on Telegram and Slack by copy pasting images from the internet browser. |
Seems like it. Maybe there are some workarounds we can apply but until then, this seems to be on their side. |
Hi guys. No actual updates / workarounds for this issue yet ? I copy/paste screenshot images all the time for work purposes and definitely do not want to have to save all images on hdd before sending over... This problem makes me have to use the web version of whatsapp, which I dislike a lot... Any progress on this would be great! Cheers for the status update and time with this :) |
I don't really have a solution for you, but I currently run chromium with
the --app flag as a way to sort of have whatsapp as a separate browser.
…On Mon, Nov 15, 2021 at 6:01 AM ravenlost ***@***.***> wrote:
Hi guys. No actual updates / workarounds for this issue yet ? I copy/paste
screenshot images *all the time* for work purposes and definitely do not
want to have to save all images on hdd before sending over... This problem
makes me have to use the web version of whatsapp, which I dislike a lot...
Any progress on this would be great! Cheers for the status update and time
with this :)
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#79 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJRW3AS7RMXLEF7GOF4ROETUMDK6XANCNFSM4V4V7SCQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Ok, thanks for the update. I'll look into doing something like that for now. |
Hi, any progress on this? hope it can be done soon...would appreciate it a lot! cause it's even more important than videocalls i think :) You can do it! :D |
Just checked epiphany if it does work there since they use |
I believe this issue should be closed. This problem is related to WebkitGTK as we can see here. |
Well, meanwhile, searching found a very good solution that can do the paste images from clipboard for whatsapp, it's called Ferdi - https://getferdi.com/ and now i'm happy cause i can have all the messengers in one place :) |
I think it will help you too, the only thing i hope one day will be available, are the videocalls in whatsapp and messenger 👍 |
Would be cool if we had something like this in AUR: https://github.com/ttys3/archlinux-webkit2gtk |
install on Ubuntu with snap, also having problem pasting images and files!!! |
Hi! Do you think this feature is possible? |
This is a problem with WebKit that strangely wasn't solved for a long time, even though it has a patch that solves it. |
I don't want to depend on that aur package instead of the stable one. If someone wants to create a different package depending on the fixed aur version i.e. |
I don't think you need to do that, the AUR package already provides webkit2gtk. But I think this info would be cool to have this info in a pinned comment in the AUR package page. |
Done! |
I think there is an event listener for Paste action. Here is my suggestion public void TextBox1_Paste(){
if (Clipboard.ContainsImage()){
TextBox1.addContent(Clipboard.getImage());
}
} There is an Object with image's Methods for clipboard Clipboard.ContainsImage(); // return True/false
Clipboard.getImage(); // get image from clipboard
Clipboard.setImage(); // put an image in the clipboard here is a link to How to use the clipboard Class. Clic here to launch!. public void TextBox1_Paste(){
if (Clipboard.ContainsImage()){
pastePopUp.show();
pastePopUp.imageList.addImage(Clipboard.getImage());
GobalMassage_var.addAttachement(Clipboard.getImage());
}
} It is not what you expect but in my mind it could look like that |
I am experiencing the same issue: I can't paste any image o the chat. |
Same issue. Using ubuntu 23.04 with wayland |
same issue using manjaro arch with xorg |
is this solved yet? |
Please just give the issue a thumbs up if you also want this to be fixed. Adding a "+1" / "Any updates?" comment and notifying everyone in the thread is not useful. If there were updates they would be posted here. |
This issue is a WebKitGTK bug and the "fix" is installing a patched webkitgtk like webkit2gtk-imgpaste |
On AUR, that would have to be handled by the user, yes. But is it not possible to ship that version of webkit2gtk in platforms like Flatpak, Snaps, and Nixpkgs? |
Have you guys found any solution? I have it currently installed on Ubuntu 22.04. |
It should be possible to ship the patched version in containerized formats like Flatpaks. I guess nobody wants to package it though. |
Still no solution in 2024 ? |
Don't understand the webkit bug discussion, but that shouldn't affect when copying from desktop env instead of the web borwser copying, right? Let me explain my scenario: I use KDE plasma with Spectacl, with it, I take a custom screenshot size, then click "copy image to clipboard" button then I try to just "CRTL + V" into Whatsapp for Linux client and nothing happens. I have to use an external tool like Kolour Paint to save it into my files (I most of the cases I don't want to save it) and then send it as an attachment. This is not an issue in Windows version of the client. Please, if don't leave this issue unresolved in 2024 |
I was running in the same issue, after Googling and reading this topic I removed Whatsapp for Linux and replaced it with ZapZap, problem solved. |
I was able to fix this in my system (Ubuntu 24.04) by rebuilding the webkit2gtk packages with the imgpaste patches. I'll describe how I did it, but this is not a viable solution/workaround for the project as a whole. This requires running commands in the terminal and customizing system packages, which might affect other programs that use webkit2gtk. That's why I won't go into more detail: if this is not enough for you to figure out the details on your own, you probably shouldn't be messing with it. Anyway, first I enabled source code repos for Ubuntu packages, then I ran I entered the In the webkit2gtk-imgpaste page in AUR, below the “Dependencies” section, there is the “Sources” section, with four files. Two of them are webkit2gtk sources, not needed because From that point on, all I had to do was make sure that I had the basic set of packages needed to build .deb packages, and follow the regular process to build binary .deb packages, which is essentially running two commands:
Once the build was finished, I left the webkit2gtk source directory (the .deb packages are saved outside of their source directory by default) and installed all the packages (replacing the ones already installed) with That fixed this problem in whatsapp-for-linux. All I have to do now is keep watch over the webkit2gtk page on the Ubuntu packages website and repeat this whole process every time the official webkit2gtk packages are updated. |
Description
Having the chat text box focused, one can't paste images from the clipboard in it.
For now, the user has to attach an image and select one from the file system.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The client should accept the contents from the clipboard and display a preview for the image, allowing to add a description, etc -- a WhatsApp feature, I believe.
Screenshots
Environment
The text was updated successfully, but these errors were encountered: