telesoho / vscode-markdown-paste-image

Smartly paste for Markdown.
MIT License
135 stars 41 forks source link

Windows: GIF are always saved to C:\ #76

Closed JimLeon595 closed 2 years ago

JimLeon595 commented 2 years ago

i have the same paste problem that the plugin shows the correct path while pasting the gif image (e.g. D:/test/xxx.gif). But the image gets stored on the C:/test/xxx.gif drive instead. Also the created link directs to C:/.

Here is the screenshots to show the error.

image

Best regards, Lukas

P.S.: Thanks by the way for this great plugin

telesoho commented 2 years ago

@JimLeon595 What happen if you paste an image? Could you tell me the extension version?

JimLeon595 commented 2 years ago

@JimLeon595 如果粘贴图像会发生什么?你能告诉我扩展版本吗? I press ctrl + alt +v to paste gif to my article (e.g. W:/test/xxx.gif),but its always change my path to C:/test/xxx.gif,though the gif picture download in the right path ,but my acticle cant show the gif properly and my version is v0.18.5

telesoho commented 2 years ago

@JimLeon595

就是说无论你是用Markdown Paste(Ctrl+Att+V)还是Markdown Download(Ctrl+Alt+D),图片保存的位置是对的,只是插入到Markdown里的链接是错的,是吗?

JimLeon595 commented 2 years ago

是的是的,哈哈哈,不好意思,我的工地英文

Markdown Paste(Ctrl+Att+V)刚刚我去尝试了一下,应该还是和原版的Markdown一样,无法直接复制gif粘贴,需要我们自己构建才能进行显示,如下图,本地 gif Markdown Paste 之后会格式被改成PNG

image

Markdown Download(Ctrl+Alt+D)只要下载的GIF图片不是放在C盘的路径上,然后他插入的位置,无论盘符是什么都会被切换为C:,如下图

image

而且这个问题的本质是针对GIF这种图片格式来说的,对于我来说,jpg,png等静态图片暂时还没遇到过相同的问题

telesoho commented 2 years ago

@JimLeon595

Markdown Paste(Ctrl+Att+V)刚刚我去尝试了一下,应该还是和原版的Markdown一样,无法直接复制gif粘贴,需要我们自己构建才能进行显示,如下图,本地 gif Markdown Paste 之后会格式被改成PNG

image

我想知道的是,用Markdown Paste粘贴的时候,图片是否被保存到了正确的路径下,比如图中的:d:/Test/2022-03-04-15-54-15.png是否被正确的保存到了d:/Test/下,然后生成的Markdown链接是否正确。

Markdown Download(Ctrl+Alt+D)只要下载的GIF图片不是放在C盘的路径上,然后他插入的位置,无论盘符是什么都会被切换为C:,如下图

image

而且这个问题的本质是针对GIF这种图片格式来说的,对于我来说,jpg,png等静态图片暂时还没遇到过相同的问题

从图里看,如果使用Markdown Download 下载图片的时候,插入Markdown的链接变成了C:,我想知道的是图片文件是被保存到了d:/Test下,还是c:/Test下,或者根本没有保存文件。

实在不好意思,我没有Windows系统,自己无法做测试,只能通过了解详细的信息来判断问题出在什么地方。

telesoho commented 2 years ago

问题可能出在这里:

https://github.com/telesoho/vscode-markdown-paste-image/blob/8bcb68beb25425fff7469cbb1f2324fbd1613a92/src/paster.ts#L576