imlinhanchao/vsc-markdown-image

Refuses to work.

Opened this issue · 10 comments

Hi there,

This extension has been very helpful while I was writing a docusaurus-based software documentation site. However, it recently stopped working and I'm struggling to understand why.

I'm using the latest VS Code (v1.83.1).

I've tried:

  • Disabling/Enabling extensions,
  • ReInstalling VS Code,
  • ReInstalling Extensions,
  • Installing Old Version of VS Code
  • Adding the documentation folder to trusted locations in VS Code
  • Deleting "extensions" folder for VS Code.
  • Installing only Markdown Image extension.

Tried launching Developer Tools and looking in there:

image

image

Extensions Output log shows this message when I try and Paste Image:
2023-10-23 14:24:50.562 [info] ExtensionService#_doActivateExtension hancel.markdown-image, startup: false, activationEvent: 'onCommand:markdown-image.paste'

I would greatly appreciate if you can advise me on what could go wrong on my side.
It used to work just fine, but just stopped working recently.

What‘s your OS?

Oh~I see. Can you copy a image, and then execute this script ? https://github.com/imlinhanchao/vsc-markdown-image/blob/master/asserts/pc.ps1

What‘s your OS?

Windows 10

Oh~I see. Can you copy a image, and then execute this script ? https://github.com/imlinhanchao/vsc-markdown-image/blob/master/asserts/pc.ps1

This is what it returns:


Active code page: 65001
Add-Type : Cannot add type. Definition of new types is not supported in this language mode.
At C:\Users\Valentin.Belets\Documents\ps1.ps1:6 char:1
+ Add-Type -Assembly PresentationCore
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : PermissionDenied: (:) [Add-Type], PSNotSupportedException
    + FullyQualifiedErrorId : CannotDefineNewType,Microsoft.PowerShell.Commands.AddTypeCommand
 
Unable to find type [Windows.Clipboard].
At C:\Users\Valentin.Belets\Documents\ps1.ps1:7 char:8
+ $img = [Windows.Clipboard]::GetImage()
+        ~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (Windows.Clipboard:TypeName) [], RuntimeException
    + FullyQualifiedErrorId : TypeNotFound

Unable to find type [Windows.Clipboard].
At C:\Users\Valentin.Belets\Documents\ps1.ps1:10 char:12
+     $img = [Windows.Clipboard]::GetFileDropList()
+            ~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (Windows.Clipboard:TypeName) [], RuntimeException
    + FullyQualifiedErrorId : TypeNotFound

no image

Although image was clearly in my clipboard:
image

You should execute the script in PowerShell

You should execute the script in PowerShell

PS C:\Users\Valentin.Belets\Documents> .\ps1.ps1
Active code page: 65001

execute like this .\ps1.ps1 image.png

PS C:\Users\Valentin.Belets\Documents> .\ps1.ps1 image.png
Active code page: 65001
image.png

Is the file image.png you copy picture? It look like work.