Import Ruty

This commit is contained in:
2024-03-11 00:54:46 +01:00
parent 2c0c53a22b
commit fbf47eaa3a
485 changed files with 67750 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
# node-imageinfo
This is a small package for node.js to allow the analysis of image data in a Buffer, and return mime-type, and image dimensions for the data.
It is designed to be fast, completely written in javascript and have no dependencies on external packages or libraries.
Currently it supports Png, Jpeg, Gif and (uncompressed) Swf analysis.
If you also have zlib available (`npm install zlib`) then it will support compressed Swf files.
## Usage:
To install imageinfo into your project, use `npm install imageinfo`, then it's simply a matter of calling it with the buffer object containing your image, like this:
var imageinfo = require('imageinfo'),
fs = require('fs');
fs.readFile('testimage', function(err, data) {
if (err) throw err;
info = imageinfo(data);
console.log("Data is type:", info.mimeType);
console.log(" Size:", data.length, "bytes");
console.log(" Dimensions:", info.width, "x", info.height);
});