Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

678
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda