1.0.1 • Published 6 years ago

image-file-size v1.0.1

Weekly downloads
34
License
MIT
Repository
github
Last release
6 years ago

image-file-size

A module for browser to get dimensions of any image file, autodetect the orientation of the image file

online demo

Usage

  • npm install --save image-file-size
import {getImageSize} from 'image-file-size'

document.getElementById('fileInput').onchange = function (event) {
  let file = event.target.files[0]
  if (file) {
    getImageSize(file)
      .then((result) => {
        document.getElementById('result').innerText = JSON.stringify(result, null, 2)
      })
  }
}

the getImageSize will return an object like {width: 100, height: 300}

LICENCE

MIT

Copyright (c) 2018-present, Xianpo (Alan) Lu

1.0.1

6 years ago

1.0.0

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago