Determining image file size + dimensions via Javascript?

后端 未结 11 1103
执念已碎
执念已碎 2020-11-22 07:00

As part of a web app, once images have been downloaded and rendered on a web page, I need to determine an image\'s file size (kb) and resolution within the browser context (

11条回答
  •  臣服心动
    2020-11-22 07:51

    You can find dimension of an image on the page using something like

    document.getElementById('someImage').width
    

    file size, however, you will have to use something server-side

提交回复
热议问题