# exif-orientation

> Returns the exif orientation is scale / rotation from a file object

Latest version **1.0.0** (published 2016-09-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install exif-orientation
pnpm add exif-orientation
yarn add exif-orientation
bun add exif-orientation
```

## 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.0 |
| Published | 2016-09-14 |
| First published | 2016-09-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 8 |
| Author | Nick Poisson |
| Maintainers | njam3 |
| Keywords | exit,, image,, file,, orientation |

## Links

- npm: https://www.npmjs.com/package/exif-orientation
- Repository: https://github.com/Jam3/exif-orientation
- Issues: https://github.com/Jam3/exif-orientation/issues
- npm.io page: https://npm.io/package/exif-orientation

## Dependencies (1)

- [exif-js](https://npm.io/package/exif-js.md) ^2.1.1

## 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.0 (latest) — 2016-09-14

## README

# exif-orientation

[![stable](http://badges.github.io/stability-badges/dist/stable.svg)](http://github.com/badges/stability-badges)

Returns the exif orientation in scale / rotation from a file object

## Install

```sh
npm install exif-orientation --save
```

## Example

The following example reacts to the `onChange` event of a file upload html input

```js
var findOrientation = require('exif-orientation');

fileUpload.addEventListener('change',function(e) {
  var file = e.target.files[0];
  findOrientation(file,function(err,orientation) {
    if (!err) {
      console.log(orientation); // displays {scale: {x: 1, y: 1}, rotation: 90}
    }
  });
});
```

## Usage

[![NPM](https://nodei.co/npm/exif-orientation.png)](https://www.npmjs.com/package/exif-orientation)

#### `findOrientation(file,callback)`

```file``` A file object from a file upload html input  
```callback``` A function to be called once the orientation data is found or an error occured. The callback is passed 2 arguments `(err,orientation)`. If `err` is undefined, orientation will contain the orientation data, otherwise err will be an `Error` object with the message of the error.

## License

MIT, see [LICENSE.md](http://github.com/Jam3/exif-orientation/blob/master/LICENSE.md) for details.

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