Skip to content

chazmo03/s3-image-size

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Detect image dimensions from AWS S3

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%