Skip to content
This repository has been archived by the owner on Apr 5, 2018. It is now read-only.
/ archived-node-sz Public archive

A Node.js utility for determining the dimensions of an image

License

Notifications You must be signed in to change notification settings

rvagg/archived-node-sz

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sz Build Status

Determine the size of an image

Depends on node-canvas which has special build instructions as it requires Cairo to be installed on your system.

Related

  • crp crops images
  • rsz resizes images
  • thmb makes thumbnails from images

API & Example

You may provide either a String specifying the path to the image or a Buffer containing the image data and you will receive an object with 'height' and 'width' properties on your callback

var sz = require('sz')
  , fs = require('fs')

sz('/path/to/nyancat.gif', function (err, size) {
  // where `size` may look like: { height: 280, width: 400 }
})

var buf = fs.readFileSync('/path/to/nyancat.gif')

sz(buf, function (err, size) {
  // where `size` will be the same as above
})

Licence

sz is Copyright (c) 2013 Rod Vagg @rvagg and licensed under the MIT licence. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE file for more details.

About

A Node.js utility for determining the dimensions of an image

Resources

License

Stars

Watchers

Forks

Packages

No packages published