{"name":"buffer-image-size","version":"0.6.4","description":"get dimensions of any image buffer","main":"./lib/index.js","types":"./lib/index.d.ts","files":["bin","lib"],"engines":{"node":">=4.0"},"scripts":{"pretest":"eslint lib specs","test":"nyc mocha specs","coverage":"nyc report --reporter=text-lcov | coveralls"},"repository":{"type":"git","url":"git+https://github.com/evidentpoint/buffer-image-size.git"},"keywords":["image","size","dimensions","resolution","width","height","png","jpeg","bmp","gif","psd","webp","svg","ico","cur"],"author":{"name":"netroy","email":"aditya@netroy.in","url":"http://netroy.in/"},"license":"MIT","dependencies":{"@types/node":"*"},"devDependencies":{"coveralls":"^3.0.0","eslint":"^4.13.1","expect.js":"^0.3.1","glob":"^7.1.1","mocha":"^4.0.1","nyc":"^11.2.1","sinon":"^4.0.2"},"gitHead":"92d014e394c05542c320c94c7d7f2b23ad449330","bugs":{"url":"https://github.com/evidentpoint/buffer-image-size/issues"},"homepage":"https://github.com/evidentpoint/buffer-image-size#readme","_id":"buffer-image-size@0.6.4","_npmVersion":"5.6.0","_nodeVersion":"9.6.1","_npmUser":{"name":"jccr","email":"juan.carlos.corona.r@gmail.com"},"dist":{"integrity":"sha512-nEh+kZOPY1w+gcCMobZ6ETUp9WfibndnosbpwB1iJk/8Gt5ZF2bhS6+B6bPYz424KtwsR6Rflc3tCz1/ghX2dQ==","shasum":"357e8173e951ced3b5a2785c695993aa29dbcac4","tarball":"http://registry-npm.ywwl.com/buffer-image-size/download/buffer-image-size-0.6.4.tgz","fileCount":18,"unpackedSize":17156,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC4ul0rWBRi27Aoo6Bpy+bgEVCpg7B4fI7TJtZ2QuucbwIhAKvQvk36O4RH0HlDGcMI2N7tC8bpMhVGj2EuB/mkn2ZQ"}],"size":6238,"noattachment":false,"key":"/buffer-image-size/-/buffer-image-size-0.6.4.tgz"},"maintainers":[{"name":"jccr","email":"juan.carlos.corona.r@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/buffer-image-size_0.6.4_1519870516301_0.49741097967319803"},"_hasShrinkwrap":false,"readme":"# buffer-image-size\n\nA [Node](https://nodejs.org/en/) module to get dimensions of any image ~~file~~ buffer\n\nFork of [image-size](https://github.com/image-size/image-size)\n\nThis fork doesn't use the 'fs' and 'path' node modules.\n\n\n## Supported formats\n\n* BMP\n* CUR\n* GIF\n* ICO\n* JPEG\n* PNG\n* PSD\n* ~~TIFF~~ (no buffer support)\n* WebP\n* SVG\n* DDS\n\n### Upcoming\n\n* SWF\n\n## Programmatic Usage\n\n```\nnpm install buffer-image-size --save\n```\n\n### Synchronous\n\n```javascript\nvar sizeOf = require('buffer-image-size');\nvar dimensions = sizeOf(yourImageBuffer);\nconsole.log(dimensions.width, dimensions.height);\n```\n\n### Asynchronous\n\nNo need for asynchronous usage in this fork.\nSee the original instead: https://github.com/image-size/image-size\n\n### Multi-size\n\nIf the target file is an icon (.ico) or a cursor (.cur), the `width` and `height` will be the ones of the first found image.\n\nAn additional `images` array is available and returns the dimensions of all the available images\n\n```javascript\nvar sizeOf = require('buffer-image-size');\nvar images = sizeOf(icoBuffer).images;\nfor (const dimensions of images) {\n  console.log(dimensions.width, dimensions.height);\n}\n```\n\n### Using a URL\n\n```javascript\nvar url = require('url');\nvar http = require('http');\n\nvar sizeOf = require('buffer-image-size');\n\nvar imgUrl = 'http://my-amazing-website.com/image.jpeg';\nvar options = url.parse(imgUrl);\n\nhttp.get(options, function (response) {\n  var chunks = [];\n  response.on('data', function (chunk) {\n    chunks.push(chunk);\n  }).on('end', function() {\n    var buffer = Buffer.concat(chunks);\n    console.log(sizeOf(buffer));\n  });\n});\n```\n\nYou can optionally check the buffer lengths & stop downloading the image after a few kilobytes.\n**You don't need to download the entire image**\n\n## Command-Line Usage (CLI)\n\nNo CLI usage in this fork.\nSee the original instead: https://github.com/image-size/image-size\n\n## Credits\n\nnot a direct port, but an attempt to have something like\n[dabble's imagesize](https://github.com/dabble/imagesize/blob/master/lib/image_size.rb) as a node module.\n\n## [Contributors](Contributors.md)\n","publish_time":1519870516382,"_cnpm_publish_time":1519870516382,"dist-tags":{"latest":"0.6.4"}}