Open walterlv opened 5 years ago
在 Visual Studio Code 里使用此插件粘贴的任何图片都是空白的,所有像素都是透明像素。
可以看到粘贴进来的图片是透明的。
在资源管理器中查看,它也是透明的(实际上粘贴的图片已经损坏不可恢复)。
但是在其他应用里面可以粘贴,例如我现在正在编写的 GitHub Issue 窗格中,是可以正常粘贴的。
The issue appears to be how PowerShell is writing the image file. If you look at the following script: mushan.vscode-paste-image-1.0.3\res\pc.ps1
Line 18:
$fcb = new-object Windows.Media.Imaging.FormatConvertedBitmap($img, [Windows.Media.PixelFormats]::Rgba64, $null, 0)
It doesn't seem to like the alpha code in 'Rgba64'. I've tried several formats here, but it seems to be the alpha code. Also appears to be a fix from Issue #29. If you just change it back to 'Rgb24', it will work again.
This is happening to me today, again, as well. It happened here and I reported it #38. Then went away. Now its back!
But only every now and then! I'm not sold on the PowerShell fix. I feel like its a timestamp thing.
My workflow:
/assets
above the .md directory...Please see #38 where I reported the same issue. To fix ( a SERIOUS pain) I had to go into SnagIt and copy the timestamps, then paste them into the image filenames in the /assets
folder.
Please consider addressing this issue.
Thank you
I swtich to 1.0.2 , hah..
@gaosjx how do you revert to previous version?
hello, can you tell me the screenshots tool that you are using?
I guess some screenshots tool take image with alpha value(Rgba64 work well) and others not(Rgba24 work well).
Does anyone know how to take image from clipboard correctly by powershell?
@SeaDude update the vscode version to 1.30.2 This version has a new feature : Choose extension version - Install earlier versions of Marketplace extensions.
@mushanshitiancai , I'm using TechSmith SnagIt. I used this workflow without issue up to 3-4 weeks ago.
@gaosjx , i'm on 1.30.2. I'll try rolling back to earlier version of Paste Image and see if that helps.
d
CONFIRMED: Rolling back to Paste Image 1.0.2 fixed this issue.
@SeaDude @gaosjx @NickSegalle @walterlv Thank you for your attempt!
I try SnagIt and get blank image too, So I rollback the code to 1.0.2 to fix this bug. Now you can update PasteImage to 1.0.4.
@mushanshitiancai 哈!刚刚收到了你的 1.0.4 的更新啦,感谢!
Description
When pasting an image into Visual Studio Code markdown file, the image will be completely blank with every pixel transparent.
How to reproduce it?
Ctrl+Alt+V
and wait for the insertion of the image.What's the environment?
What happened?
You can see that the image pasted is transparent.
And to reveal it in the explorer, it is also transparent.
But actually, it can be pasted into other applications such as what I'm writing on GitHub issues.