s3-image-size

Detect image dimensions via Amazon S3

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
s3-image-size
800.1.36 years ago7 years agoMinified + gzip package size for s3-image-size in KB

Readme

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.