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

Image Copy from cherrytree into Microsoft Teams does not work. #2665

Open
poleguy opened this issue Mar 6, 2025 · 0 comments
Open

Image Copy from cherrytree into Microsoft Teams does not work. #2665

poleguy opened this issue Mar 6, 2025 · 0 comments

Comments

@poleguy
Copy link
Contributor

poleguy commented Mar 6, 2025

Proposed Change
If a single image is copied in cherrytree do not use html format for the clipboard. Instead use an image format. This will allow pasting into Teams/Chrome.

Version, Operating system
Description: Ubuntu 22.04.5 LTS

Describe the bug
If I copy an image from cherrytree and try to paste it into Teams it does not work. I present a workaround here using xclip.

To Reproduce
Steps to reproduce the behavior:

  1. Go to Teams
  2. Copy an image someone sent you.
  3. Paste it into cherrytree. (It works.)
  4. Paste it into Teams. (It works.)
  5. Right click on image in cherrytree.
  6. Select Copy Image
  7. Paste it into cherrytree. (It works.)
  8. Paste it into Teams. (It doesn't work.)
  9. Run this work-around command in terminal:
    xclip -o -selection clipboard -t image/png | xclip -i -selection clipboard -t image/png
  10. Paste into Teams. (Now it works.)

Screenshots
At step 3 and 4 the clipboard has this result:

$ xclip -o -selection clipboard -t TARGETS
TIMESTAMP
TARGETS
SAVE_TARGETS
MULTIPLE
chromium/x-source-url
image/png
text/html

At steps 7 and 8 the clipboard has this result:

$ xclip -o -selection clipboard -t TARGETS
TIMESTAMP
TARGETS
MULTIPLE
UTF8_STRING
CTD_RICH
text/html
HTML Format
image/png

At step 10 the clipboard has this result:

$ xclip -o -selection clipboard -t TARGETS
TARGETS
image/png

Discussion
I don't think it's actually a bug with Cherrytree per-se. However this is a pain in practice because I often want to share my notes on teams with copy/paste, so if cherrytree can smooth it out that would be a plus.

Ideally Teams/Chrome would correctly paste html with images intact. I'm not sure if this is something that can be fixed by not using /tmp files and doing some sort of html encoding instead. Obviously there will be tradeoffs there for large files, etc. Yuck.

Teams/Chrome seems to paste as html, because if I select a section of text and images, the text pastes correctly into teams and only the images are left out.

I notice that I can paste the image from cherrytree nicely into LibreOffice Writer. And if I copy just the image out of LibreOffice Writer I can then paste it into Teams. If I do that the clipboard has this result:

$ xclip -o -selection clipboard -t TARGETS
TIMESTAMP
TARGETS
MULTIPLE
SAVE_TARGETS
application/x-openoffice-svxb;windows_formatname="SVXB (StarView Bitmap/Animation)"
application/x-openoffice-objectdescriptor-xml;windows_formatname="Star Object Descriptor (XML)";classname="8BC6B165-B1B2-4EDD-aa47-dae2ee689dd6";typename="LibreOffice 24.8 Text Document";viewaspect="1";width="35373";height="18424";posx="0";posy="0"
image/png
application/x-openoffice-gdimetafile;windows_formatname="GDIMetaFile"
application/x-openoffice-emf;windows_formatname="Image EMF"
application/x-openoffice-wmf;windows_formatname="Image WMF"
image/svg+xml;windows_formatname="image/svg+xml"
application/x-openoffice-bitmap;windows_formatname="Bitmap"
image/bmp
application/x-libreoffice-internal-id-632898

If I select text and image in LibreOffice Writer I get the same problem where I can't paste to Teams.

xclip -o -selection clipboard -t TARGETS
TIMESTAMP
TARGETS
MULTIPLE
SAVE_TARGETS
application/x-openoffice-embed-source-xml;windows_formatname="Star Embed Source (XML)"
text/rtf
text/richtext
text/html
text/plain;charset=utf-16
application/x-openoffice-link;windows_formatname="Link"
application/x-openoffice-objectdescriptor-xml;windows_formatname="Star Object Descriptor (XML)";classname="8BC6B165-B1B2-4EDD-aa47-dae2ee689dd6";typename="LibreOffice 24.8 Text Document";viewaspect="1";width="17000";height="3000";posx="0";posy="0"
text/plain;charset=utf-8
UTF8_STRING
STRING
application/x-libreoffice-internal-id-632898

I don't know all the details of how this is supposed to work or whose fault it is that this doesn't work: Teams? Chrome? Ubunutu/Linux? Cherrytree?

But I suspect this is a problem because Chrome isn't reading the images from /tmp/ where the png files are stored during copy/paste probably due to security concerns.

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

No branches or pull requests

1 participant