# imageinfo

> A node.js package that returns information about an image or flash file such as type, dimensions etc.

Latest version **1.0.4** (published 2011-09-04) · 0 weekly downloads

## Install

```sh
npm install imageinfo
pnpm add imageinfo
yarn add imageinfo
bun add imageinfo
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2011-09-04 |
| First published | 2011-08-25 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.4 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 59 |
| Author | Norganna |
| Maintainers | norganna |
| Keywords | image, info, jpg, jpeg, png, gif, swf, dimensions, size, type, mime, format |

## Links

- npm: https://www.npmjs.com/package/imageinfo
- Repository: https://github.com/NorgannasAddOns/node-imageinfo
- Issues: https://github.com/NorgannasAddOns/node-imageinfo/issues
- npm.io page: https://npm.io/package/imageinfo

## Alternatives

- [exif-parser](https://npm.io/package/exif-parser.md) — 3.8M weekly downloads
- [vite-plugin-compression](https://npm.io/package/vite-plugin-compression.md) — 569.5K weekly downloads
- [pica](https://npm.io/package/pica.md) — 442.4K weekly downloads
- [@reportportal/client-javascript](https://npm.io/package/@reportportal/client-javascript.md) — 408.8K weekly downloads
- [@tldraw/state](https://npm.io/package/@tldraw/state.md) — 316.0K weekly downloads

## Recent versions

- 1.0.4 (latest) — 2011-09-04
- 1.0.3 — 2011-09-03
- 1.0.2 — 2011-08-25
- 1.0.1 — 2011-08-25
- 1.0.0 — 2011-08-25

## README

# 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);
	});

---
_Source: https://npm.io/package/imageinfo · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
