joplin
joplin copied to clipboard
Images missing when pasting into webapps and some desktop apps from Joplin
Operating system
Linux
Joplin version
2.14
Desktop version info
No response
Current behaviour
See the corresponding forum issue.
Currently, many apps can't paste the images copied from Joplin's rich text editor or markdown preview pane.
On Linux:
- LibreOffice Writer: Works (images shown)
- LibreOffice Calc: Works (images shown)
- LibreOffice Impress: Doesn't work (text, but no images)
- GMail in Firefox, GMail in Chrome: Doesn't work (text, but no images)
On Windows,
- Paste into Word on Windows 11: Works (images shown)
- Paste into Outlook desktop on Windows 11: Works (images shown)
- Paste into WordPad on Windows 11: Doesn't work (text, but no images)
- Paste into Word Online on Windows 11: Doesn't work (text, but no images)
Possible reason why this is happening
I think it's because text copied to the clipboard (at least from the rich text editor) looks like this to a website:
{
'text/html': '<div id="rendered-md">\n<p>The following is a <strong>test</strong> image:</p>\n<p><img src="file:///home/primary/.config/joplin-desktop/resources/bdef250506d9444cabe9f190358c8b98.png" alt="Screenshot from 2024-03-06 07-23-02.png"></p>\n<p> </p>\n<p>This is a test.</p>\n</div>',
'text/plain': 'The following is a **test** image:\n\n\n\n \n\nThis is a test.',
'files': Empty FileList
}
Notice that above, the <img
tags are specifie using file:// URLs, which can't be accessed by most/all websites.
Expected behaviour
No response
Logs
No response
@personalizedrefrigerator maybe we can use data:image/png;base64 urls for loading the image in this way image would be copied correctly including the other content to be fixed,would it be right to do so?
maybe we can use data:image/png;base64 urls for loading the image in this way image would be copied correctly including the other content to be fixed,would it be right to do so?
Good idea! I think that would work. Here's a list of considerations for this:
- If an image is very large, we may not want to convert it to
data:image/png;base64
. - To avoid duplicating resource files, it might also be necessary to add a
data-resourceid
field to theimg
tag when copying.- When copy/pasting between Joplin profiles, we'll need logic to make sure a non-existing resource isn't linked to.
Edit: Adjusted formatting.
can I work on this issue?
we don't assign issues, if you feel doing it, simply do it