read-image-size-promise
Promise to detect the image dimensions from a file, using image-size-stream
// +-----------+// | |// 240px | foo.jpg |// | |// +-----------+// 320px var readImageSizePromise = ; ;
Installation
npm install read-image-size-promise
Supported image formats
Check image-size-stream doc.
API
var readImageSizePromise = ;
readImageSizePromise(imageFilePath [, options])
imageFilePath: String
(local file path)
options: String
(directly passed to fs.createWriteStream options and image-size-stream option)
Return: Object
(Promise)
When it detects the width and height of the image file, it will be fulfilled with an object in the form {width: [Number], height: [Number], type: [String]}
as an argument.
type
will be one of the following strings: bmp
gif
jpg
png
psd
svg
tiff
webp
When it fails to read the file, or the file is not supported, it will be rejected with an error as an argument.
var imageSize = ; var { console;}; var { console;}; ;
License
Copyright (c) 2014 Shinnosuke Watanabe
Licensed under the MIT LIcense.