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

DESKTOP: Paste does not work for images #2663

Open
Rishabh-malhotraa opened this issue Mar 5, 2020 · 19 comments
Open

DESKTOP: Paste does not work for images #2663

Rishabh-malhotraa opened this issue Mar 5, 2020 · 19 comments
Labels
bug It's a bug desktop All desktop platforms upstream There's a problem with upstream code.

Comments

@Rishabh-malhotraa
Copy link
Contributor

Rishabh-malhotraa commented Mar 5, 2020

Description

Paste function for Images do not work the way it should me (both Right click-> paste and Ctrl+V) when pasting images to Joplin editor.

Actual behaviour

paste-bug

Expected Behaviour

paste-expected-behaviour

Tasks

  • Enable Paste feature for images
  • Ensure it works for both the methods (Right click-> paste and Ctrl+V)

@PackElend @tessus @laurent22 @bedwardly-down what do you guys think about this, and if this behaviour is indeed unexpected and should be fixed then I would like to work on it.

@Rishabh-malhotraa Rishabh-malhotraa added the bug It's a bug label Mar 5, 2020
@laurent22 laurent22 added the high High priority issues label Mar 5, 2020
@laurent22
Copy link
Owner

Thanks for looking into it @Rishgod, it's indeed a bug that would need to be fixed. If you can look at it that would be great.

@bedwardly-down
Copy link
Contributor

There's also another three other things that happen (at least on mobile):

  1. pasting any images with text in them, Joplin turns the text part into a text entry in your note instead of pasting the image (could be OCR related)
  2. attaching images using the Attach image function doesn't place the image at the cursor but at the bottom of the not
  3. when multiple images are attached at one time, they aren't attached in proper order but seemingly random placement

Since all clients share the same code for much of the core functions, is it possible these could all be caused by the same bug in the code or be separate bugs altogether?

@laurent22
Copy link
Owner

pasting any images with text in them, Joplin turns the text part into a text entry in your note instead of pasting the image (could be OCR related)

It's been looked at by several people and so far no good fix for this. When there's text and image at the same time, it's hard to guess what should be pasted (there are several discussions about this here and the forum).

when multiple images are attached at one time, they aren't attached in proper order but seemingly random placement

Perhaps add a bug about this? I guess they should be sorted in alphabetical order? I found that this issue is not really Joplin specific. Whenever I import multiple files in any app, the order is often random.

attaching images using the Attach image function doesn't place the image at the cursor but at the bottom of the not

It indeed should insert at cursor so feel free to create a separate GH issue for this.

@bedwardly-down
Copy link
Contributor

Heading to work but will try to do here in a bit. Thanks

@deadpool1999
Copy link

Copying an image from a web browser (chrome ) and then doing the above mentioned operations{ctrl+v} gives the desired result!!
It's some security issue with chrome i guess, like for a div element with contentEditable="true" everything works fine as long as the copy paste happens b/w similar environments.
(So copying from chrome and pasting the image in my note works fine, but the same isn't true for a remote location(desktop). )

@Rishabh-malhotraa
Copy link
Contributor Author

Copying an image from a web browser (chrome ) and then doing the above mentioned operations{ctrl+v} gives the desired result!!
It's some security issue with chrome i guess, like for a div element with contentEditable="true" everything works fine as long as the copy paste happens b/w similar environments.
(So copying from chrome and pasting the image in my note works fine, but the same isn't true for a remote location(desktop). )

@deadpool1999 thanks for pointing it out, I look into the same.

@yasithdev
Copy link

yasithdev commented Mar 5, 2020

Hello everyone, would you mind if I take on this issue?

@Rishabh-malhotraa
Copy link
Contributor Author

Hello everyone, would you mind if I take on this issue?

hey @yasithmilinda I' almost done with this, mind taking some other issue :)

@yasithdev
Copy link

Hey @Rishgod, no problem! :) I'll look into other issues, thanks!

@Rishabh-malhotraa
Copy link
Contributor Author

After doing a lot of research and trying everything it is not possible to Implement this feature

B3

When I was trying to fix this, I was really surprised to find out that clipboardImageCheck is always true, irrespective of the fact that the clipboard has an image or not.

b0-gif


When you copy an image in Windows Explorer, you are copying the file instead of copying the contents of the image. But that's, not the case if you take a screenshot or copy the photo from a picture app.

b2-gif

It does not look like Electron supports this feature, I google a lot about it and I also found a lot of similar issue on GitHub.

There are certain workaround to it I found on Github, here

It basically how to get file pointers in the clipboard, but it can only get only one file's path if multi files are copied(the very first image if you select many).

@laurent22 Thoughts?

@deadpool1999
Copy link

Yes , electron js uses node and chromium , so this issue can't be solved. This issue also exists with the word online and also the docs online version (when opened in chrome) but it is not the same if opened in Firefox ! Trying to read the clipboard content also shows 0 items in it. So can't also use some other api to upload the image somewhere and then fetch it in chrome!

@tessus
Copy link
Collaborator

tessus commented Mar 10, 2020

@PackElend we have an upstream label. Does your external mean the same?

@PackElend
Copy link
Collaborator

it properly means the same; i refer to code outside the Joplin universe, so basically 3rd party dependencies

I renamed the label to allow better filtering on externals.

@PackElend PackElend added the upstream There's a problem with upstream code. label Mar 10, 2020
@laurent22 laurent22 added desktop All desktop platforms and removed Electron labels Mar 18, 2020
@laurent22 laurent22 removed the high High priority issues label Apr 7, 2020
@ffgm
Copy link

ffgm commented Apr 9, 2020

@laurent22

@kuraci
Copy link

kuraci commented May 31, 2020

Srtongly hope this bug fixed.
When copy only one image to joplin,image is well copied.
The image source code looks like :
![aeee9eaf6f8200d572cc214ef8150f19.png](:/70790836e2a7486790cae028e4ae11de)

But if copy more, such as with some words , only are copied. Image would lost while link of image left. Image would display well in loacal device but the image on remote device will lost,because the image link the lacal path
The image source code looks like :
![aeee9eaf6f8200d572cc214ef8150f19.png](file:https:///F:/%E5%BC%A0%E5%B9%B4%E4%BF%9D/%E6%96%B0%E5%BB%BA%E6%96%87%E4%BB%B6%E5%A4%B9%20(2)/_resources/70790836e2a7486790cae028e4ae11de.png)

@madrix01
Copy link

madrix01 commented Aug 7, 2021

Hello everyone, I'm an intermediate developer, I love open source and looking forward for participating in GSoC'22. I want to start contributing to Joplin. Can someone guide me for the same and I also wanted to know how to contact a mentor for GSoC'22.
Thank you!

@laurent22
Copy link
Owner

laurent22 commented Aug 7, 2021

There's no mentor to contact yet since we have nothing ready for 2022, but if in the meantime you want to get used to the codebase, a good option is to check the issue tracker from time to time and see if you can work on the issues with labels "bug" and "high". Or alternatively you can try to find some good plugin idea and work on it.

@robertchen
Copy link

copy HTML and paste to word, word has images, but copy html contents paste to joplin, the images are lost

@oryoruk
Copy link

oryoruk commented Jun 17, 2024

I am having this issue (Joplin 2.14.22). I can drag and drop images fine, but cannot paste images/image screenshots into the markdown or rich-text editors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug It's a bug desktop All desktop platforms upstream There's a problem with upstream code.
Projects
None yet
Development

No branches or pull requests