Comments (5)
Very very thank you for you experiment!
I update plugin, fix this bug and enhance the log system. You can try it.
from vscode-paste-image.
Hello, I try it in my windows 10, and it's ok
from vscode-paste-image.
You can do a test. First save this powershell script to a file named "ps.pc1":
param($imagePath)
# Adapted from https://github.com/octan3/img-clipboard-dump/blob/master/dump-clipboard-png.ps1
Add-Type -Assembly PresentationCore
$img = [Windows.Clipboard]::GetImage()
if ($img -eq $null) {
"no image"
Exit 1
}
if (-not $imagePath) {
"no image"
Exit 1
}
$fcb = new-object Windows.Media.Imaging.FormatConvertedBitmap($img, [Windows.Media.PixelFormats]::Rgb24, $null, 0)
$stream = [IO.File]::Open($imagePath, "OpenOrCreate")
$encoder = New-Object Windows.Media.Imaging.PngBitmapEncoder
$encoder.Frames.Add([Windows.Media.Imaging.BitmapFrame]::Create($fcb)) | out-null
$encoder.Save($stream) | out-null
$stream.Dispose() | out-null
$imagePath
And then you copy a image, open a powershell window, run this script: powershell -f ps.pc1 "D:\\test.png"
, observe the output.
from vscode-paste-image.
It just prints out the argument given. And image is created at the given location
from vscode-paste-image.
I have found the issue;
It turns out that if powershell
is not added into the system environmental variables the code required for paste will throw an exception since it is not able to launch the powershell script
I am doing a pull request to fix this issue. Adding the full powershell path into the variable powershell should fix this problem in case users dont have powershell.exe added to system env. vars
from vscode-paste-image.
Related Issues (20)
- How to get the default name to be YYYY-MM-DD_HH-mm-ss_<selected text>
- New line character support for pasteImage.insertPattern
- Could not find any matching file with following pattern: puppet/shared.pp
- encoding image file name HOT 6
- Unable to change the default name (using a format)
- Adjusting image size?
- Use on VSCode for the Web
- Windows paste image is not working on vscode insider, cannot generate image file, but work correctly on normal vscode
- Suggestion: When pasting non-image content, fall back to normal paste command
- Add 'Paste Image' to Context Menu to pick up the base path more easily HOT 1
- [Suggestion]: Add file summary md5 to the file name
- Settings do not apply. HOT 4
- There is not a image in clipboard & can't capture screenshots in markdown
- alt text feature
- If the image has spaces on it, the preview does not works
- Suggestion - file name encoding use dash instead of URL
- [Suggestion]: Rename file after paste
- can it works if powershell is disabled?
- mac osx 14 copy image to remote linux hint 'There is not a image incliboard'
- Pasted Images Do Not Appear in Specified Folder When Using VSCode Remote on Ubuntu from MacOS HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vscode-paste-image.