image-info-from-stream

0.3.0 • Public • Published

image info from stream

Build Status Coverage Status

introduction

access image size from stream.

support image file types:

  • .jpg
  • .png
  • .gif
  • .bmp

usage

Callback

const getImageInfo = require('image-infor-from-stream');
const stream = fs.createReadStream('test.png');

stream.pipe(
  getImageInfo(res => {
    const { width, height, type } = res;
    const name = `${width}x${height}.${type}`;
  })
);

External Object

const getImageInfo = require('image-infor-from-stream');
const stream = fs.createReadStream('test.png');
const meta = {};

stream
  .pipe(getImageInfo(meta))
  .on('finish', () => {
    const { width, height, type } = meta;
    const name = `${width}x${height}.${type}`;
  });

Readme

Keywords

Package Sidebar

Install

npm i image-info-from-stream

Weekly Downloads

0

Version

0.3.0

License

MIT

Unpacked Size

9.21 kB

Total Files

8

Last publish

Collaborators

  • elcarim5efil