1 Pages (13 items)
It is impossible to paste image from clipboard. Ubuntu/Mono - Messages
#1 Posted: 10/17/2020 9:21:32 AM
I can drag an image from File Manager to SMath but I can't paste a copied image from clipboard to SMath.
#2 Posted: 10/17/2020 11:26:34 AM
I made a tool to help me with this. It's pretty clunky and will be a little embarassing to share, but it is useful. I'll put it on github, hopefully later today.
#3 Posted: 10/18/2020 12:10:23 AM
The code for the tool is uploaded to github now. It's a screengrabber-type tool rather than doing anything with what's already on the clipboard. Hopefully it will be helpful.
What I faced when trying to insert images from a file on disk was that they would be invisible then next time I opened the SMath sheet. They've done okay for me when using this method though.
https://github.com/erictmyers/insert_image_to_smath
What I faced when trying to insert images from a file on disk was that they would be invisible then next time I opened the SMath sheet. They've done okay for me when using this method though.
https://github.com/erictmyers/insert_image_to_smath
#4 Posted: 10/18/2020 2:29:41 AM
that's pretty sweet!
i will try it with devuan and see how it works.
what anaysis program is that in Linux that you are using?
i will try it with devuan and see how it works.
what anaysis program is that in Linux that you are using?
Join the SMath Studio Users Discord Channel: https://discord.gg/PayZpJW
#5 Posted: 10/18/2020 4:39:06 AM
Spent some time on it under debugger but it seems I cannot do anything here.
Image copied from another app is just not visible under Mono. Ok with a text, but not with images.
I can imaging to integrate some Linux specific script (python or something else) which will get image from Clipboard and put it somewhere on the disk as a file, so SMath Studio could import that file. If it will be automated then it will be transparent to the user.
Best regards.
Image copied from another app is just not visible under Mono. Ok with a text, but not with images.
I can imaging to integrate some Linux specific script (python or something else) which will get image from Clipboard and put it somewhere on the disk as a file, so SMath Studio could import that file. If it will be automated then it will be transparent to the user.
Best regards.
#6 Posted: 10/18/2020 10:59:05 AM
WroteSpent some time on it under debugger but it seems I cannot do anything here.
Image copied from another app is just not visible under Mono. Ok with a text, but not with images.
I can imaging to integrate some Linux specific script (python or something else) which will get image from Clipboard and put it somewhere on the disk as a file, so SMath Studio could import that file. If it will be automated then it will be transparent to the user.
Best regards.
I guess this is not a bug. Linux has different handling with image clipboard afaik.
One of basic paint program I use (mtpaint) has this issue too.
First you need to "import" linux clipboard into mtpaint clipboard with a menu button. Then you can paste image into mtpaint.
Or if you want to copy an image from mtpaint to system clipboard you have to "export" it to system clipboard via a button.
What I want to say is maybe this script could work. But I think this is not a bug, functionality approach of linux.
Regards.
1 users liked this post
Andrey Ivashov 10/18/2020 11:55:00 AM
#7 Posted: 10/18/2020 2:08:02 PM
Wrotethat's pretty sweet!
i will try it with devuan and see how it works.
what anaysis program is that in Linux that you are using?
The analysis is from a python FEA library called PyNite, installable via pip.
If anyone has checked out the utility and found it usable, be advised that I'll update it soon to do away with the need to copy and paste into a text editor. That is a relic of how an earlier version was written, but can be simplified now. I'll post back here when it's ready.
#8 Posted: 10/19/2020 4:44:19 PM
Okay, the new version of the tool is released at https://github.com/erictmyers/insert_image_to_smath.

There is a warning in the README, but I'll add it here as well- the tool writes directly to the selected SMath files. I haven't had any problems with that yet but testing has been minimal, so please make backups before clicking the Insert Image button.
Best regards, I hope you'll find it helpful!
There is a warning in the README, but I'll add it here as well- the tool writes directly to the selected SMath files. I haven't had any problems with that yet but testing has been minimal, so please make backups before clicking the Insert Image button.
Best regards, I hope you'll find it helpful!
1 users liked this post
Andrey Ivashov 10/19/2020 7:09:00 PM
#9 Posted: 10/19/2020 9:02:16 PM
#10 Posted: 10/19/2020 10:34:03 PM
Another method which is very simple and a little tricky. You will need "xclip" for this, a small X program.
Xclip is maybe already installed or you will need get it from your favorite linux distribution's repo.
Also there should be an image on clipboard. (obviously)
Not very elegant but you can extract clipboard to a file easily and drag it into SMath.
1 - Open the terminal, enter the command;
xclip -selection clipboard -t image/png -o > example.png
This will create a picture file from clipboard which is named "example.png" in terminal directory.
2 - Drag the file directly to smath.
That's it.
Edit: Sometimes SMath doesn't fully get base64 data of dragged file to picture region.
Image region can get full base64 data if you right click and import the file.
Need more investigation.
Xclip is maybe already installed or you will need get it from your favorite linux distribution's repo.
Also there should be an image on clipboard. (obviously)
Not very elegant but you can extract clipboard to a file easily and drag it into SMath.
1 - Open the terminal, enter the command;
xclip -selection clipboard -t image/png -o > example.png
This will create a picture file from clipboard which is named "example.png" in terminal directory.
2 - Drag the file directly to smath.
That's it.
Edit: Sometimes SMath doesn't fully get base64 data of dragged file to picture region.
Image region can get full base64 data if you right click and import the file.
Need more investigation.
#11 Posted: 10/20/2020 5:54:40 PM
Another updated version is available at https://github.com/erictmyers/insert_image_to_smath. It features a much nicer (resizable and movable) area selection, and is cross platform for what that's worth. It requires a newish version of PyQt and Qt (5.10 or higher)
This is the last tweak I plan for now.

This is the last tweak I plan for now.
#12 Posted: 10/20/2020 8:08:10 PM
#13 Posted: 10/20/2020 8:24:57 PM
WroteWroteThis is the last tweak I plan for now.
Can you just have 10 kB *.PNG instead of 1.3 MB Monster Big ?
My apologies, I may have been insensitive to bandwidth issues. Hopefully the file size hasn't caused too much trouble for anyone, I'll try to do better in future posts.
Best regards,
Eric
1 Pages (13 items)
-
New Posts
-
No New Posts