tre-image-size

1.1.0 • Public • Published

tre-image-size

A small pull-stream wrapper around a couple of image size detectors provided by image-sise.

Currently supported formats:

  • jpg
  • png
  • svg
  • webp
const detect = require('.')
const pull = require('pull-stream')
const file = require('pull-file')

pull(
  file('fixtures/bmp_24.png'),
  detect(meta => {
    t.equal(meta.format, 'png')
    t.equal(meta.width, 200)
    t.equal(meta.height, 200)
  }),
  pull.onEnd( err => {
    t.error(err)
  })
)

API

detect(onMeta [, opts])

Options are

  • maxBufferSize Don't buffer more than this amout of bytes. If no format was detected, give up. Defaults to 512 * 1024 (512kb)

License: MIT

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.1.0
    4
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.1.0
    4
  • 1.0.1
    0
  • 1.0.0
    0

Package Sidebar

Install

npm i tre-image-size

Weekly Downloads

4

Version

1.1.0

License

MIT

Unpacked Size

806 kB

Total Files

9

Last publish

Collaborators

  • regular