Skip to content
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

This plug-in is great, but it seems that it cannot read and write win11 clipboard images, but it can monitor hasImage #21

Closed
Tester-957 opened this issue Apr 10, 2024 · 12 comments · Fixed by #22

Comments

@Tester-957
Copy link

Latest examples used

image

@HuakunShen
Copy link
Collaborator

I just checked on Win11. The problem indeed exists. It comes from an upstream library. clipboard-rs

@ChurchTao Can you take a quick look? I also get The image format could not be determined on Win11 when I run the example code in clipboard-rs repo.

@ChurchTao
Copy link

@Tester-957
My bad, it will be fixed soon.
ChurchTao/clipboard-rs#15

@HuakunShen
Copy link
Collaborator

@Tester-957 Fixed in v0.6.2.
@ChurchTao Thank you!

@Tester-957
Copy link
Author

@Tester-957在 v0.6.2 中修复。 @ChurchTao谢谢你!
我发现
The new version fixes the problem of reading the clipboard, but writing pictures to the clipboard still fails. In the example, click the Write Image (Base64) or Write Image (Binary) buttons to read them in the example interface. This image cannot be pasted in third-party applications such as WeChat or the drawing software that comes with win11.
image

@Tester-957
Copy link
Author

Thank you very much for your help 🌹. Today I also tried to use the examples in MAC OS and found a small problem: when I used the "Feishu" office software and used its screen cutting function, the cut screen image could not be monitored by the examples (hasImage:false ) Others are also “false”. I'll test other software tomorrow to see if this problem exists (can provide more information if needed).

@HuakunShen
Copy link
Collaborator

@Tester-957 Confirmed the Feishu screenshot problem on Mac, Win11 and Ubuntu22. Same problem on Mac, but not on Win11 or Ubuntu22.
Also tested WeChat on MacOS. WeChat's screenshots could be read by clipboard-rs.

Note: screenshot written by Feishu could be read by https://crates.io/crates/arboard.
We may need to look at the difference between Arboard and clipboard-rs.

Also confirmed the Windows image pasting problem.

@HuakunShen HuakunShen reopened this Apr 11, 2024
@HuakunShen
Copy link
Collaborator

HuakunShen commented Apr 11, 2024

Feishu clipboard image bug located.

Here is the available format for a regular screenshot: ["public.png", "Apple PNG pasteboard type", "public.tiff", "NeXT TIFF v4.0 pasteboard type"]

Here is the available format for a Feishu screenshot ["public.tiff", "NeXT TIFF v4.0 pasteboard type"]

clipboard.dataForType(NSPasteboardTypeTIFF) will return screenshots from Feishu.
TIFF is supported by both regular screenshot and Feishu screenshot (verified), so you could simply replace NSPasteboardTypePNG with NSPasteboardTypeTIFF
However, it might be prudent to handle both TIFF and PNG formats for has() and get_image(), ensuring compatibility across different scenarios. Supporting both formats is a safer approach.
@ChurchTao

@ChurchTao
Copy link

@HuakunShen
Copy link
Collaborator

HuakunShen commented Apr 12, 2024

@Tester-957
Copy link
Author

Tester-957 commented Apr 13, 2024

@HuakunShen During use, I found a possible performance problem🤔. When using the API to read the Image or using the listener, I found that when the image is large, the main process will be blocked. This is the blocking time-consuming situation I debugged. It can happen in rust layer.I tried to copy a 4k picture, but the interface was blocked for about 7 seconds and became inoperable.
image

@HuakunShen
Copy link
Collaborator

HuakunShen commented Apr 14, 2024

@Tester-957 Thank you for mentioning. Addressed in #25
In release mode it should be much faster.

You can open a new issue for a new bug. Otherwise I might miss your message in this closed issue.

@Tester-957
Copy link
Author

@Tester-957 Thank you for mentioning. Addressed in #25谢谢你的提及。已解决 #25 In release mode it should be much faster. 在发布模式下它应该快得多。

You can open a new issue for a new bug. Otherwise I might miss your message in this closed issue.您可以为新错误打开一个新问题。否则我可能会错过你在这个已关闭问题中的留言。

🆗,Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants