Closed quentgoutaland closed 1 year ago
How do you paste the image? Did you call formattedPaste
command or just Ctrl-C?
I tested both (all other extensions disabled). I called formattedPaste
from the command palette but it also copied the path.
I also tried replacing the default template with the one given in the demo and get the same result.
Can you check the "output" panel? There should be something like this:
[20:44:56] formattedPaste
[20:44:56] Performing formatted paste
[20:44:56] Pasting: Image
[20:44:56] ./images/
[20:44:56] ./images/
[20:44:56] ./images/
Here it is. It seems, it does not consider my .jpg as an image.
[14:50:51] formattedPaste [14:50:51] Performing formatted paste [14:50:51] Pasting: Table [14:50:51] Failed to find delimited table [14:50:51] Doesn't look like a table [14:50:51] Failed to find , delimited table [14:50:51] Doesn't look like a table [14:50:51] Failed to find | delimited table [14:50:51] Doesn't look like a table [14:50:51] No table found
I dont have a Linux desktop to test this. Can you try pasting it elsewhere? The image pasting process only begins when the extension couldn't find text in your clipboard. On other OS this seems ok. Maybe on Linux we need another way to test if there is an image in the clipboard?
And please try if this script can save your image by:
./saveclipimg-linux.sh filename.jpg
ls filename.jpg
When I clean my clipboard and trigger FormattedPaste
from the command palette, I am prompt to enter the image name. Since there is no image in my clipboard, nothing is copied and I get the message "no image found in clipboard".
With the above script executed after I copied an image (with Ctrl + C), it seems to paste the file, but it is empty.
When I clean my clipboard and trigger FormattedPaste from the command palette, I am prompt to enter the image name. Since there is no image in my clipboard, nothing is copied and I get the message "no image found in clipboard".
this is the expected behavior
With the above script executed after I copied an image (with Ctrl + C), it seems to paste the file, but it is empty.
This seems pretty weird 🤔
Here is an example (before/after I execute the script)
This command saves image in your clipboard to filename.jpg
.
Also, pasting image files isn't supported (yet, on linux, see #363, #364 and #358). Make sure you have image in your clipboard.
Ok, so it did save the image to my clipboard.
Then using FormattedPaste
from the palette still copy the path.
I'll try fix this after I refactor some old code
Ok, thanks!
Copy the file and pasting using the palette works almost as expected (it first pastes the path and then the image template is activated). Drag&drop still paste the path (but I assume the functionality is not supported for Linux).
can you try pasting image on that vsix? Pasting file and drag&drop isn't supported.
Pasting using (Ctrl + V or Ctrl + Alt + V) gives the same result as the palette:
For the output when FormattedPaste
is used:
[08:56:31] withTelemetry: formattedPaste
[08:56:31] Performing formatted paste
[08:56:31] Pasting: Image. imgFile: undefined
[08:56:31] Pasting: Table
[08:56:31] Failed to find delimited table
[08:56:31] Doesn't look like a table
[08:56:31] Failed to find , delimited table
[08:56:31] Doesn't look like a table
[08:56:31] Failed to find | delimited table
[08:56:31] Doesn't look like a table
[08:56:31] No table found
[08:56:31] withTelemetry: onDidChangeTextDocument
[08:56:31] withTelemetry: onDidChangeTextDocument
[08:56:37] Image path: ~/test/java_convention.png
[08:56:40] save and paste. imagePath: ~/test/java_convention.png
[08:56:40] withTelemetry: onDidChangeTextDocument
[08:56:46] withTelemetry: onDidChangeActiveTextEditor_tex_wordcounter
fix.zip @quentgoutaland can you try this one, use command palette and post all logs
It seems to work correctly! The path is not pasted, when I trigger the palette it asks me the name of the image and pastes it using the template.
[09:13:01] withTelemetry: formattedPaste [09:13:01] Performing formatted paste [09:13:01] Pasting: Image. imgFile: undefined [09:13:12] Image path: ~/test/figures/DSCF0627.jpg [09:13:12] save and paste. imagePath: ~/test/figures/DSCF0627.jpg [09:13:12] paste image success. returning
Does it fix your problem?
Yes! Thank you!
Disable all the other extensions except for LaTeX Workshop and LaTeX Utilities, and check that you still see this issue.
You still see this issue?: Yes
Describe the bug
Hi!
When I copy/paste (or drag&drop holding shift) an image to my latex document, only the path of the image is copied. I tried when setting graphicspath, but nothing changed.
Desktop