s3-image-size

0.1.3 • Public • Published

s3-image-size

NPM version Dependency Status devDependency Status

Detect image dimensions of images on Amazon S3. It does so by trying to extract image size via image-size on each chunk received. When the dimensions are present, the request is aborted.

Based on http-image-size.

Usage

var size = require('s3-image-size');
var AWS = require('aws-sdk');
var s3 = new AWS.S3({region: 'some region'})
size(s3, 'some bucket', 'some key', function(err, dimensions, bytesRead) {
  console.log(err, dimensions, bytesRead);
});

The callback receives three arguments: err, dimensions, bytesRead:

dimensions is in the form { height: 1063, width: 1600 }

bytesRead is the number of bytes read from s3

License

Copyright (c) 2015 Charles D. Augello Licensed under the MIT license.

Package Sidebar

Install

npm i s3-image-size

Weekly Downloads

96

Version

0.1.3

License

MIT

Last publish

Collaborators

  • chazmo03