Feature request_Copy paste images from web browser

182 views
Skip to first unread message

Xuan Truong Duong

unread,
Jul 21, 2017, 1:06:00 AM7/21/17
to TreeSheets
Dear Author(s) of Treesheet,

First of all thank you for a wonderful app. Since switching from Windows to Linux Mint, I have been on a quest to search for a note taking app that can replace onenote on Windows. I stumbled upon Treesheet and really like it. I just want to ask whether Treesheet supports images copying and pasting from web browsers, I tried but it only shows the description text behind the images. Is there any switch or option to make it work?

Thank you very much.

Wouter van Oortmerssen

unread,
Jul 21, 2017, 2:10:39 PM7/21/17
to trees...@googlegroups.com
It supports pasting in image data from the clipboard.. I've only ever tested that this works on Windows though.

This uses the clipboard functionality in wxWidgets, so if this doesn't work under Linux, this may well be a wxWidgets bug (assuming it works in other apps).

--
You received this message because you are subscribed to the Google Groups "TreeSheets" group.
To unsubscribe from this group and stop receiving emails from it, send an email to treesheets+unsubscribe@googlegroups.com.
To post to this group, send email to trees...@googlegroups.com.
Visit this group at https://groups.google.com/group/treesheets.
For more options, visit https://groups.google.com/d/optout.

Andrew Norris

unread,
Jul 21, 2017, 3:00:56 PM7/21/17
to trees...@googlegroups.com
works on mac.
--
Say yes to this moment

Xuan Truong Duong

unread,
Jul 22, 2017, 8:56:06 AM7/22/17
to TreeSheets
I have just tested again (both on Linux Mint and Windows 10), it seems that if I copy the image only (with no text), then I can paste it directly to treesheets. But if the selection includes both images and text, then only text and the description text behind the images are pasted. Is it possible to copy and paste a selection consists of both images and text?

Thank you very much.


On Saturday, July 22, 2017 at 1:10:39 AM UTC+7, Wouter wrote:
It supports pasting in image data from the clipboard.. I've only ever tested that this works on Windows though.

This uses the clipboard functionality in wxWidgets, so if this doesn't work under Linux, this may well be a wxWidgets bug (assuming it works in other apps).
On Thu, Jul 20, 2017 at 7:28 PM, Xuan Truong Duong <dxt...@gmail.com> wrote:
Dear Author(s) of Treesheet,

First of all thank you for a wonderful app. Since switching from Windows to Linux Mint, I have been on a quest to search for a note taking app that can replace onenote on Windows. I stumbled upon Treesheet and really like it. I just want to ask whether Treesheet supports images copying and pasting from web browsers, I tried but it only shows the description text behind the images. Is there any switch or option to make it work?

Thank you very much.

--
You received this message because you are subscribed to the Google Groups "TreeSheets" group.
To unsubscribe from this group and stop receiving emails from it, send an email to treesheets+...@googlegroups.com.

Andrew Norris

unread,
Jul 22, 2017, 10:16:19 AM7/22/17
to trees...@googlegroups.com
Hi. You need to take a screenshot. Here is a method that works on windows 10 :- 

To Take a Screenshot of Part of Your Screen

Press “Windows + Shift + S”. Your screen will appear grayed out and your mouse cursor will change. Click and drag on your screen to select the part of your screen you want to capture. A screenshot of the screen region you selected will be copied to your clipboard. 


To unsubscribe from this group and stop receiving emails from it, send an email to treesheets+unsubscribe@googlegroups.com.

To post to this group, send email to trees...@googlegroups.com.
Visit this group at https://groups.google.com/group/treesheets.
For more options, visit https://groups.google.com/d/optout.

Andrew Norris

unread,
Jul 22, 2017, 10:19:17 AM7/22/17
to trees...@googlegroups.com
Note would not be able to edit the text in that method, as copies the text and image into one new image containing all. If you want to edit: you can copy the text and images separately. 

Xuan Truong Duong

unread,
Jul 22, 2017, 10:51:47 AM7/22/17
to TreeSheets
Here is some screenshots:

1. This is an example of the page I want to copy both image & text (the selection):

2. This is what I saw when I pasted into Treesheets (the image was not pasted at all):

3. This is the result that I imagined it should have been (I copied the image and the text separately):



Wouter van Oortmerssen

unread,
Jul 22, 2017, 1:20:37 PM7/22/17
to trees...@googlegroups.com
I don't think this is something TreeSheets has control over. When you select both images and text, the browser probably chooses to put the text in the clipboard.

Your best bet is probably 2 separate copy-paste actions.

Are there any other apps that allow you to paste both at once? E.g. a word-processor?

Xuan Truong Duong

unread,
Jul 23, 2017, 4:42:26 AM7/23/17
to TreeSheets

Yes, Microsoft Word, Librewriter, Onenote all copy and paste both text and images perfectly (on both Windows and Linux). There is also an cross-platform open source note taking app named Mytetra that can do this. Here is a screen shot I took when paste into Word, Librewriter and Mytetra on Linux Mint:




And this is the link to Mytetra:
Binary: https://webhamster.ru/site/page/index/articles/projectcode/138
Source: https://github.com/xintrea/mytetra_dev



On Sunday, July 23, 2017 at 12:20:37 AM UTC+7, Wouter wrote:
I don't think this is something TreeSheets has control over. When you select both images and text, the browser probably chooses to put the text in the clipboard.

Your best bet is probably 2 separate copy-paste actions.

Are there any other apps that allow you to paste both at once? E.g. a word-processor?
On Sat, Jul 22, 2017 at 7:51 AM, Xuan Truong Duong <dxt...@gmail.com> wrote:
Here is some screenshots:

1. This is an example of the page I want to copy both image & text (the selection):

2. This is what I saw when I pasted into Treesheets (the image was not pasted at all):

3. This is the result that I imagined it should have been (I copied the image and the text separately):



--
You received this message because you are subscribed to the Google Groups "TreeSheets" group.
To unsubscribe from this group and stop receiving emails from it, send an email to treesheets+...@googlegroups.com.

Andrew Norris

unread,
Jul 23, 2017, 5:03:32 AM7/23/17
to trees...@googlegroups.com
I see the wx code to read text :- 

if (wxTheClipboard->IsSupported( wxDF_TEXT ))
{
wxTheClipboard->GetData( data );
wxMessageBox( data.GetText() );
}

Could do something similar to get an image from clipboard if also there? Would not be obvious which box to paste the text in though. Also if wanted multiple images and text in one go that would be more difficult.  

To unsubscribe from this group and stop receiving emails from it, send an email to treesheets+unsubscribe@googlegroups.com.

To post to this group, send email to trees...@googlegroups.com.
Visit this group at https://groups.google.com/group/treesheets.
For more options, visit https://groups.google.com/d/optout.

Xuan Truong Duong

unread,
Jul 23, 2017, 6:47:17 AM7/23/17
to TreeSheets
I've dig around a little bit and realized that when I make a selection consisting of both images and text in a browser, the images are actually NOT put into clipboard. I believe that only the links to the images are put there. The programs such as Word and Librewriter actually look for these links and download the images.

Here is the content of the clipboard when I try to copy the selection from the browser (I use the xclip tool on Ubuntu, the command is "$

xclip -o -t TARGETS"):


1. Copy only images from Firefox:

TIMESTAMP
TARGETS
MULTIPLE
text/html
text/_moz_htmlinfo
text/_moz_htmlcontext
image/png
image/bmp
image/x-bmp
image/x-MS-bmp
image/tiff
image/jpeg
image/x-icon
image/x-ico
image/x-win-bitmap

2. Copy both image and text from Firefox:
TIMESTAMP
TARGETS
MULTIPLE
text/html
text/_moz_htmlcontext
text/_moz_htmlinfo
UTF8_STRING
COMPOUND_TEXT
TEXT
STRING
text/x-moz-url-priv

3. Copy both image and text from Chromium
TIMESTAMP
TARGETS
SAVE_TARGETS
MULTIPLE
STRING
UTF8_STRING
TEXT
text/plain

On Windows, you can use this free clipboard manager tool to see what is in the clipboard:
http://www.nakka.com/soft/clcl/index_eng.html

Wouter van Oortmerssen

unread,
Jul 23, 2017, 12:51:00 PM7/23/17
to trees...@googlegroups.com
The code that does pasting is here:

I just tested on Windows:
If I make a selection in Chrome that includes both text and images:
- If I right-click to copy above the image, it copies the image, and goes into the image case in the code.
- If instead I right-click to copy above the text, it goes into the unicode text case in the code.
- if I just ctrl-v it becomes unicode text.

There doesn't appear to be a way to get multiple bits of content from the clipboard in wxWidgets, even in Windows.

I've checked that if text is received, the corresponding image object is empty (even though it was part of what I copied).

I though that maybe the solution would be to instead receive HTML, which could contain both. I experimented with that here: https://github.com/aardappel/treesheets/commit/88e8806c7dd72687bb10e5b05e35eeac43369153
However, even when "preferring" HTML, I still get unicode text.

So maybe it is possible in Linux if you're not using wxWidgets and parse the clipboard manually?



To unsubscribe from this group and stop receiving emails from it, send an email to treesheets+unsubscribe@googlegroups.com.

Xuan Truong Duong

unread,
Jul 25, 2017, 10:36:45 AM7/25/17
to TreeSheets
Once this text & images pasting feature is included, my quest of looking for a good cross-platform note app will be fulfilled :D.

By the way, since I'm just a noob in programming, especially in C & C++, all I could find are the following articles (and the code is for python, gtk and on linux :( ), I put them here with just a slight hope that they can be useful in some way:

https://stackoverflow.com/questions/3261379/getting-html-source-or-rich-text-from-the-x-clipboard
https://unix.stackexchange.com/questions/78395/save-html-from-clipboard-as-markdown-text
https://askubuntu.com/questions/427704/how-can-i-edit-the-source-of-html-in-the-clipboard
and this book that is recommended on wxWidget website: https://docs.google.com/viewer?url=https%3A%2F%2Fptgmedia.pearsoncmg.com%2Fimages%2F0131473816%2Fdownloads%2F0131473816_book.pdf

Wouter van Oortmerssen

unread,
Jul 25, 2017, 11:12:41 AM7/25/17
to trees...@googlegroups.com
Thanks.. but the solution has to be in wxWidgets, so most of those links do not apply.

To unsubscribe from this group and stop receiving emails from it, send an email to treesheets+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages