Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

667
Visualizações
VSCode Extension API: How to obtain the properties of an image file?

I'm creating a VS Code extension and I need to get the properties of image files, only the dimensions/size of the image file using JS(I.e., 1200 × 627). Like the piece of information such as the “Size” that shows in the bottom right corner of the status bar in VS Code when an image file is opened.

I have to do this with either a CDN link of the image, like

https://www.cloudflare.com/static/d2cf82ac895f472c6d208cdccf4e722e/cdn-lc.png or path to the local disk's directory like

I:\Projects\VSCode Extensions\test\New folder\desktop-banner-web.jpg without loading/previewing the image anywhere. Just the retrieval of natural height & width of the image file would suffice for calculations and displaying the result(ratio) to the user. I'm currently getting the URL or the path to the image using Selection (Have to get it without entering the link or path manually) So it could read the image file and provide me with the size/dims, but since VS Code doesn't expose the DOM, I couldn't use JS to find the dimensions, which can be done easily. I tried to get the size/dims using the stat method under FileSystemProvider in the VS Code API Doc but to no avail. Are there any possibilities of achieving this without going over to the Webview?

If someone could provide me with a working code using only JavaScript to get the height & width of any image file in any way of a CDN link or a path, I would greatly appreciate it as I couldn't find anything near this in my research. Thanks in advance.

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda