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

"Paste image from clipboard" - Compatibility #2323

Closed
YamatoRyou opened this issue Jul 31, 2021 · 34 comments · Fixed by #2378
Closed

"Paste image from clipboard" - Compatibility #2323

YamatoRyou opened this issue Jul 31, 2021 · 34 comments · Fixed by #2378

Comments

@YamatoRyou
Copy link

YamatoRyou commented Jul 31, 2021

  • Operating System: x64 Windows 7
  • Delta Chat Version: 1.20.3 (Dev)
  • Expected behavior: The images copied from any program to the clipboard should be pasted correctly to Delta Chat.
  • Actual behavior: See below for details.
  • Steps to reproduce the problem: n/a
  • Screenshots: n/a
  • Logs: n/a

#2319
I tested the following software's clipboard function and found the problem when it was pasted into Delta Chat.
Chrome 86: The image cannot be displayed normally when pasted into Delta Chat.
Internet Explorer 11: The image cannot be displayed normally when pasted into Delta Chat.
Firefox 79: The image cannot be displayed normally when pasted into Delta Chat.
Delta chat: Paste the image normally (click on the image from chat and copy from the right-click menu).
The result is as shown below:
{3025051C-E5CA-0D5F-427F-C8E0F50B7526}

I have an additional screenshot tool, guess this may be caused by the image format in the clipboard. If you don't select "ScreenShot", this problem will not occur.
{DE369208-F95C-0250-9664-8439D1149AC9}

@Jikstra
Copy link
Contributor

Jikstra commented Aug 13, 2021

What format is the pasted image?

@YamatoRyou
Copy link
Author

What format is the pasted image?

Are you referring to the case where this function works normally?
Then the pasted image format is PNG.
{83E15AA1-663C-7FD5-213D-1D56CEEE2916}

BTW: All preview versions built in the last period of time will randomly appear blank faults. It seriously affects the user experience.
{E9DA9F34-B79C-0F00-455D-CD04BCAFF08E}

@Jikstra
Copy link
Contributor

Jikstra commented Aug 13, 2021

BTW: All preview versions built in the last period of time will randomly appear blank faults. It seriously affects the user experience.

That's why it's a preview built ;) I'm currently not running master, so not sure what's going on there exactly, but there will be some big changes in the next days/weeks that will affect stability. Probably switch to a stable version?

Are you referring to the case where this function works normally?

No, where it's not working. Can you figure out the format of the snipaste tool if it's not working?

@YamatoRyou
Copy link
Author

BTW: All preview versions built in the last period of time will randomly appear blank faults. It seriously affects the user experience.

That's why it's a preview built ;) I'm currently not running master, so not sure what's going on there exactly, but there will be some big changes in the next days/weeks that will affect stability. Probably switch to a stable version?

Because I urgently need this feature, I have been paying attention to the update status of the portable program during the recent period. As long as there is an update, I will download it for a trial.
In addition, I would like to recommend a free clipboard viewer, which may be helpful for debugging.
https://freeclipboardviewer.com/

@Jikstra
Copy link
Contributor

Jikstra commented Aug 13, 2021

Because I urgently need this feature,

Hmm maybe we can make a more stable build for you with this feature.

BTW: All preview versions built in the last period of time will randomly appear blank faults. It seriously affects the user experience.

Looking again at the exception, i had this too yesterday. I think it happens as soon as any error is getting thrown. Probably the stack parser is making problems @Simon-Laux

In addition, I would like to recommend a free clipboard viewer, which may be helpful for debugging.
https://freeclipboardviewer.com/

Thank you, but I rarely use windows.

Can you turn on debugging and tell us more about the format of the non working paste? You can turn on debugging logs if you start DeltaChat from cmd/powershell like this: ./DeltaChat.exe --log-debug --log-to-console.

@YamatoRyou
Copy link
Author

YamatoRyou commented Aug 13, 2021

Can you turn on debugging and tell us more about the format of the non working paste? You can turn on debugging logs if you start DeltaChat from cmd/powershell like this: ./DeltaChat.exe --log-debug --log-to-console.

The test cannot continue. Because once I press Ctrl + V, there is a very high probability that the Delta Chat interface will become blank.
File name used for testing: deltachat-desktop-2329.portable.exe, version 1.20.3-DevBuild (git: v1.20.3-58-g6b0d39b1-backend-cleanup)


@YamatoRyou
Copy link
Author

YamatoRyou commented Aug 13, 2021

No, where it's not working. Can you figure out the format of the snipaste tool if it's not working?

I have roughly observed how Delta Chat treats the images in the clipboard. It may be picky about the format: the Windows version of Delta Chat may only accept PNG but not BMP. This leads to "copying images from different programs to Clipboard and pasting to Delta Chat have different behaviors".
{8E08AD71-3B10-A49F-B7C5-49A40ED42633}
{BD8B0F2D-8551-9F12-56A0-B215D2DB3150}

@Jikstra
Copy link
Contributor

Jikstra commented Aug 13, 2021

Yes, i expect something similiar. Can you try out the windows preview build of #2336 ? I fixed some errors that you had, this should also help debugging this problem. In case you get any more blanks, please open an issue with the error, i will try to fix it :) Thanks for testing our unstable previews :)

@YamatoRyou
Copy link
Author

Yes, i expect something similiar. Can you try out the windows preview build of #2336 ? I fixed some errors that you had, this should also help debugging this problem. In case you get any more blanks, please open an issue with the error, i will try to fix it :) Thanks for testing our unstable previews :)

".\deltachat-desktop-2336.portable_2.exe" --log-debug --log-to-console
I repeated the pasting operation several times, but it didn't seem to be reflected in the log.
Whether it is a Chromium terminal or \DeltaChatData\logs*.log
Maybe my operation method is incorrect? I will still provide the desensitized log.
{B31C65F0-4DA9-EE01-5425-FF7B1C6A9CA3}.log

@Jikstra
Copy link
Contributor

Jikstra commented Aug 13, 2021

Maybe it's not possible with the portable build. Maybe you can try ".\deltachat-desktop-2336.portable_2.exe" -- --log-debug --log-to-console. For errors in the renderer the console output is needed. They don't get written to the log (yuuup its a problem)

@YamatoRyou
Copy link
Author

YamatoRyou commented Aug 13, 2021

Maybe it's not possible with the portable build. Maybe you can try ".\deltachat-desktop-2336.portable_2.exe" -- --log-debug --log-to-console. For errors in the renderer the console output is needed. They don't get written to the log (yuuup its a problem)

".\deltachat-desktop-2336.portable_2.exe" -- --log-debug --log-to-console

It may contain the information you need.
{E963D0ED-9BF1-7E16-C2D8-FA5A13C9B7A9}.log

The pasted image at this time looks like this:
{97BF09D5-A411-ECEA-76AD-235F0283733B}


P.S.: The CPU usage of this program is abnormal.
Version 1.20.3-DevBuild (git: v1.20.3-69-gcbd01427-fix_master)
{2DCF661B-C0F3-A699-CB88-055B23DC2FAE}

@Jikstra
Copy link
Contributor

Jikstra commented Aug 13, 2021

It may contain the information you need.

2021-08-13T15:03:30.325Z	renderer/composer     	DEBUG		"paste: received file: \"\" \"image.png\""
2021-08-13T15:03:30.325Z	renderer/ipc          	DEBUG		"sendToBackend: EVENT_DC_DISPATCH_CB 32 extras.writeClipboardToTempFile "
2021-08-13T15:03:30.325Z	main/ipc              	DEBUG		"EVENT_DC_DISPATCH_CB (32) : extras.writeClipboardToTempFile "
2021-08-13T15:03:30.326Z	main/deltachat/extras 	DEBUG		"Clipboard available formats:"	["image/png"]
2021-08-13T15:03:30.326Z	main/deltachat/extras 	DEBUG		"Writing clipboard image/png to file I:\\TMP\\paste.png"
2021-08-13T15:03:30.329Z	renderer/ipc          	DEBUG	

Somehow deltachat thinks it's a png, but should be a bmp i guess.

P.S.: The CPU usage of this program is abnormal.

Screenshot_20210813_175619

Quite chill for me, is this a regression in the recent time?

@YamatoRyou
Copy link
Author

Quite chill for me, is this a regression in the recent time?

I just tried v1.20.3-70-ge07dfbc7-fix_master, and the CPU usage is still abnormal.
I guess it only appears in certain OS.
{26A830E0-A8B7-859C-823F-EBADC267000E}

@Jikstra
Copy link
Contributor

Jikstra commented Aug 13, 2021

Can you try the stable released 1.20.3 ? https://download.delta.chat/desktop/v1.20.3/DeltaChat%201.20.3.exe

@YamatoRyou
Copy link
Author

Can you try the stable released 1.20.3 ? https://download.delta.chat/desktop/v1.20.3/DeltaChat%201.20.3.exe

This version was normal.
{78C16F77-1644-097B-D003-4B7FACF51961}

@Jikstra
Copy link
Contributor

Jikstra commented Aug 13, 2021

Probably this is the problem: Update to electron 13.1.6. Ay fucking electron. @Simon-Laux when can we switch to tauri? ^^

@YamatoRyou
Copy link
Author

YamatoRyou commented Aug 14, 2021

Probably this is the problem: Update to electron 13.1.6. Ay fucking electron. @Simon-Laux when can we switch to tauri? ^^

It is the next day, and the computer has restarted.
Now this problem has disappeared, and the cause is unknown.
{CA7CA619-D980-476B-83E0-4E20482BDE5F}
I will continue to use this version until the stable version is released.

@Jikstra
Copy link
Contributor

Jikstra commented Aug 14, 2021

That's goodish. Please report any problems you have with that version, I don't know of anybody else using deltachat-desktop on win7 :)

@YamatoRyou
Copy link
Author

YamatoRyou commented Aug 14, 2021

That's goodish. Please report any problems you have with that version, I don't know of anybody else using deltachat-desktop on win7 :)

The reason why I don't use the desktop version on Windows 10: #2263
The Windows 10 Enterprise LTSC is installed on the laptop, and it is not convenient to upgrade or reinstall other SKUs for a period of time.

@Simon-Laux
Copy link
Member

@Simon-Laux when can we switch to tauri? ^^

when we removed all dependencies to electron from the backend code and completed making all desktop used apis available in https://github.com/deltachat/dc_cmd_api and doing the other steps to make it ready.
Also for tauri we might need to transpile the frontend code, because we then will have multiple possible browsers in which it needs to run.

@Jikstra
Copy link
Contributor

Jikstra commented Aug 16, 2021

@Simon-Laux when can we switch to tauri? ^^

when we removed all dependencies to electron from the backend code and completed making all desktop used apis available in https://github.com/deltachat/dc_cmd_api and doing the other steps to make it ready.
Also for tauri we might need to transpile the frontend code, because we then will have multiple possible browsers in which it needs to run.

Probably offtopic talk about tauri, but could we get a small example running where we have dc_cmd_api + tauri running with a small react example using esbuild...? I think having this stack ready could be quite nice for further experiments.

@jchook
Copy link
Contributor

jchook commented Aug 31, 2021

Am I understanding correctly:

  • an important UX feature which didn't exist before was added
  • happens to have issues with a rare custom "BMP screenshots" configuration on Windows 7

This should not hold up a release IMO.

@YamatoRyou
Copy link
Author

YamatoRyou commented Aug 31, 2021

Am I understanding correctly:

  • an important UX feature which didn't exist before was added
  • happens to have issues with a rare custom "BMP screenshots" configuration on Windows 7

This should not hold up a release IMO.

In short: this is indeed a feature that can greatly enhance the user experience. However, on Windows, this feature seems to be picky about the image format in the clipboard. It accepts PNG / JPEG / GIF / WEBP format (tested). However, a considerable part of the images copied to the clipboard by the program are in BMP format. If you try to paste such an image into Delta Chat, an exception will occur.

@Jikstra
Copy link
Contributor

Jikstra commented Aug 31, 2021

Because I urgently need this feature, I have been paying attention to the update status of the portable program during the recent period. As long as there is an update, I will download it for a trial.

Plus you are saying that you are okay with blocking everyone else on the planet from having this feature, when you already know how to make the update work on your own computer by using a different option in your screenshot program.

Don't worry, no release will be blocked because of this issue ;)

This pr is currently blocking the release, but it's almost done; #2342

@YamatoRyou
Copy link
Author

Because I urgently need this feature, I have been paying attention to the update status of the portable program during the recent period. As long as there is an update, I will download it for a trial.

Plus you are saying that you are okay with blocking everyone else on the planet from having this feature, when you already know how to make the update work on your own computer by using a different option in your screenshot program.

As a user, feedback is my right, you are welcome.

@groovenectar
Copy link

groovenectar commented Sep 2, 2021

As a user, feedback is my right, you are welcome.

No problem, it had just been some time since the work had been done... I run into this all the time, and then I thought maybe this thread is what halted it... Now I realize it is actually #2342

@Jikstra
Copy link
Contributor

Jikstra commented Sep 2, 2021

As a user, feedback is my right, you are welcome.

@YamatoRyou And very appreciated :)

Now I realize it is actually #2342

#2342 is quite finished, you can use the preview builds to try it out.

https://download.delta.chat/desktop/preview/deltachat-desktop-2342.AppImage
https://download.delta.chat/desktop/preview/deltachat-desktop-mas-2342.zip
https://download.delta.chat/desktop/preview/deltachat-desktop-2342.portable.exe

@YamatoRyou
Copy link
Author

As a user, feedback is my right, you are welcome.

@YamatoRyou And very appreciated :)

Now I realize it is actually #2342

#2342 is quite finished, you can use the preview builds to try it out.

https://download.delta.chat/desktop/preview/deltachat-desktop-2342.AppImage
https://download.delta.chat/desktop/preview/deltachat-desktop-mas-2342.zip
https://download.delta.chat/desktop/preview/deltachat-desktop-2342.portable.exe

After testing, it still doesn't work.

Version being tested:
File name: deltachat-desktop-2342.portable.exe
SHA-1: 4b610e5b9033a474493b2c1391647d3bd1350526
Version: 1.20.3-DevBuild (git: v1.20.3-112-g9766eaf2-fix_accounts_api2)

Test method record (GIF):
{D31047CD-EDE5-A461-6EEC-3116798E4047}


  • The animation only demonstrates the process of "copying an image from Chromium to the clipboard and pasting it to Delta Chat.
  • If you copy the BMP image through Windows Explorer (or desktop), it will be pasted as an attachment in Delta Chat.

@YamatoRyou
Copy link
Author

YamatoRyou commented Sep 2, 2021

As a user, feedback is my right, you are welcome.

@YamatoRyou And very appreciated :)

Now I realize it is actually #2342

#2342 is quite finished, you can use the preview builds to try it out.

https://download.delta.chat/desktop/preview/deltachat-desktop-2342.AppImage
https://download.delta.chat/desktop/preview/deltachat-desktop-mas-2342.zip
https://download.delta.chat/desktop/preview/deltachat-desktop-2342.portable.exe

This is a change of the clipboard, to demonstrate Chrome and Snipaste respectively:
{4F95E53A-5EBF-A585-19EF-28FBF7D633E0}

@Jikstra
Copy link
Contributor

Jikstra commented Sep 2, 2021

After testing, it still doesn't work.

It wasn't about this issue :)

@YamatoRyou
Copy link
Author

YamatoRyou commented Sep 2, 2021

After testing, it still doesn't work.

It wasn't about this issue :)

Well. Regarding this issue, in order to provide as much debugging information as possible, I additionally tested the latest preview version, and changed the operating system and browser. Pasting the BMP image is still not available. Do I need to provide a log?
{3375BAFB-78F5-93A7-1288-F5721B735EF8}

@YamatoRyou
Copy link
Author

YamatoRyou commented Sep 3, 2021

After testing, it still doesn't work.

It wasn't about this issue :)

Found 3 new issues.
Version 1.20.3-DevBuild (git: v1.20.3-117-gfcb35807-fix_accounts_api2)

  1. Notification push does not work. This time, neither Windows 7 nor Windows 11 can push notifications.
    2. Unable to create the "DeltaChat" folder in the mailbox. This problem has not been confirmed yet. This is what I found while using the Android client version 1.22.1. This problem will cause the Android and Windows clients to prompt "Connecting" ..." (for a long time), this problem will not affect the sending and receiving of emails. Manually creating this folder in webmail or disabling "monitoring DeltaChat folder" can temporarily solve this problem. This problem was in the last official version ( Windows: 1.20.3, Android: 1.20.5) does not appear (it may also be because these versions do not monitor the connection, which makes me not sensitive to this issue). The specific behavior of this issue: It can only be created after logging in after manually entering the server parameters, but it will not be created if it is imported directly from the backup. Should an issue be created for this phenomenon?
  2. The account cannot be deleted in the account list. After deleting it, restart it and you can see that the deleted account is back. The following is the log recorded from clicking "Delete Account" in the second confirmation dialog box:
renderer/ipc DEBUG "sendToBackend: EVENT_DC_DISPATCH_CB 6 login.removeAccount 2"
main/ipc DEBUG "EVENT_DC_DISPATCH_CB (6): login.removeAccount 2"
renderer/dialogs/DialogController DEBUG "Close dialog with id: 1"
core/event INFO "DC_EVENT_INFO" 0 "src\\context.rs:178: stopping IO"
renderer/ipc DEBUG "EVENT_DD_DISPATCH_RETURN_6_login.removeAccount" "Got back return: [truncated]"
renderer/ipc DEBUG "sendToBackend: EVENT_DC_DISPATCH_CB 7 login.accounts "
main/ipc DEBUG "EVENT_DC_DISPATCH_CB (7): login.accounts "
renderer/ipc DEBUG "EVENT_DD_DISPATCH_RETURN_7_login.accounts" "Got back return: [truncated]"

In addition, I also found that no matter how many accounts are in the account list, the user name is always displayed as "Me". I think this is not very good.

@groovenectar
Copy link

I tested the paste feature from the repo and it works perfectly on Linux. Can't wait to get it via a Flathub update :)

I'm hoping the fine tuning for other systems can come later. I might be willing to help in that case. I do see there are multiple ways to determine the MIME type with JavaScript (ES5) on the client side: https://stackoverflow.com/a/29672957 .. but it's already working in Linux and certain Windows configurations, just needs a little more checking to determine the MIME type to cover all the bases in Windows specifically

@groovenectar
Copy link

#2342 is quite finished, you can use the preview builds to try it out.

https://download.delta.chat/desktop/preview/deltachat-desktop-2342.AppImage
https://download.delta.chat/desktop/preview/deltachat-desktop-mas-2342.zip
https://download.delta.chat/desktop/preview/deltachat-desktop-2342.portable.exe

Tested the paste in the preview version and it works perfectly :) :) :)

Though FYI, to get the preview version running I had to create a directory after seeing this error:

Fatal Error during init
Error: ENOENT: no such file or directory, rename '/home/username/.config/DeltaChatDev/accounts' -> '/home/username/.config/DeltaChatDev/accounts_old'

Once I created the directory /home/username/.config/DeltaChatDev/accounts

It opened fine... Note that other than the preview version tonight, I'm using Flatpak for the mainline install.. So I assume it was expecting a directory to already be there from a non-Flatpak install

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

Successfully merging a pull request may close this issue.

5 participants