# exif-image-auto-rotation

> Auto rotate uploaded images based on their exif data.

Latest version **1.0.3** (published 2015-10-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install exif-image-auto-rotation
pnpm add exif-image-auto-rotation
yarn add exif-image-auto-rotation
bun add exif-image-auto-rotation
```

## 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.3 |
| Published | 2015-10-27 |
| First published | 2015-09-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 2 |
| Author | John Carmichael |
| Maintainers | johncarmichael |
| Keywords | autorotate, rotate, exif, jpeg |

## Links

- npm: https://www.npmjs.com/package/exif-image-auto-rotation
- Repository: https://github.com/johnc1984/exif-image-auto-rotation
- Issues: https://github.com/johnc1984/exif-image-auto-rotation/issues
- npm.io page: https://npm.io/package/exif-image-auto-rotation

## Dependencies (3)

- [gm](https://npm.io/package/gm.md) 1.19.0
- [async](https://npm.io/package/async.md) 1.5.0
- [exif-parser](https://npm.io/package/exif-parser.md) 0.1.9

## Recent versions

- 1.0.3 (latest) — 2015-10-27
- 1.0.2 — 2015-09-21
- 1.0.1 — 2015-09-20
- 1.0.0 — 2015-09-20

## README

# exif-image-auto-rotation
Auto rotate uploaded images based on their exif data.

This module requires imagemagick or graphicsmagick installed on your server for gm to run, however I am guessing if you are looking for this kind of module you may already have that bit sorted.
See here for more info: https://www.npmjs.com/package/gm

That said, the installation of this module is fairly straight forward; either:
1) run "npm install exif-image-auto-rotation"
or
2) add "exif-image-auto-rotation": "latest" to your package.json file.

Example 1 - pass an array of image paths to auto-rotate:
```
var autoRotate = require('exif-image-auto-rotation');
var images = [
	'/var/image_uploads/image_one.jpeg',
	'/var/image_uploads/image_two.jpeg',
];
autoRotate( images );
```

Example 2 - pass a single image to correct
```
var autoRotate = require('exif-image-auto-rotation');
autoRotate( '/var/image_uploads/image_one.jpeg' );
```

Example 3 - run callback after rotation of image(s) have completed
```
var autoRotate = require('exif-image-auto-rotation');
var images = [
	'/var/image_uploads/image_one.jpeg',
	'/var/image_uploads/image_two.jpeg',
];
autoRotate( images, function(){
	//something really cool!
} );
```

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