# @prmichaelsen/fix-image-orientation

> Accepts a Blob of an image file as an argument and returns the dataURL with orientation applied and exif removed.

Latest version **1.0.4** (published 2023-12-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install @prmichaelsen/fix-image-orientation
pnpm add @prmichaelsen/fix-image-orientation
yarn add @prmichaelsen/fix-image-orientation
bun add @prmichaelsen/fix-image-orientation
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2023-12-06 |
| First published | 2023-11-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 28.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Koji Murata |
| Maintainers | prmichaelsen |
| Keywords | image, exif, orientation, png, jpeg, zero-dependency |

## Links

- npm: https://www.npmjs.com/package/@prmichaelsen/fix-image-orientation
- Repository: https://github.com/prmichaelsen/fix-image-orientation
- Homepage: https://github.com/prmichaelsen/fix-image-orientation#readme
- Issues: https://github.com/prmichaelsen/fix-image-orientation/issues
- npm.io page: https://npm.io/package/@prmichaelsen/fix-image-orientation

## 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) — 2023-12-06
- 1.0.3 — 2023-12-06
- 1.0.2 — 2023-12-06
- 1.0.1 — 2023-11-27
- 1.0.0 — 2023-11-27
- 0.0.1 — 2023-11-14

## README

<h1 align="center">@prmichaelsen/fix-image-orientation</h1>

<div align="center">
<a href="https://www.npmjs.com/package/@prmichaelsen/fix-image-orientation"><img src="https://img.shields.io/npm/v/@prmichaelsen/fix-image-orientation.svg" alt="npm"></a>
<a href="https://github.com/prmichaelsen/fix-image-orientation/actions/workflows/build-and-test.yml"><img src="https://github.com/prmichaelsen/fix-image-orientation/actions/workflows/build-and-test.yml/badge.svg" alt="Build and test"></a>
<a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/github/license/prmichaelsen/fix-image-orientation.svg?style=flat" alt="license"></a>
</div>

<h4 align="center">
  Accepts a Blob of an image file as an argument and returns the dataURL with orientation applied and exif removed.
</h4>

## Features

- Zero Dependency
- Lightweight

## Usage

```html
<input id="file" type="file" />
<img id="preview" />

<script>
  const preview = document.getElementById("preview");
  const input = document.getElementById("file");

  input.addEventListener("change", (event) => {
    const file = event.target.files[0];

    imageFileToOrientationFixedDataURL(file).then((url) => {
      preview.src = url; // data:image/png;base64,iVBORw0K...
    });
  });
</script>
```

## Supported Format

- jpeg
- png

If an unsupported format is received, it returns dataURL without processing.

## Installation

```
npm install --save @prmichaelsen/fix-image-orientation
```

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