@mish-tv/fix-image-orientation
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

@mish-tv/fix-image-orientation

npm Build and test license

When this function receives a Blob of an image file as an argument, it returns the dataURL with orientation applied and exif removed.

Features

  • Zero Dependency
  • Lightweight

Usage

<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 @mish-tv/fix-image-orientation

Package Sidebar

Install

npm i @mish-tv/fix-image-orientation

Weekly Downloads

2

Version

0.0.1

License

MIT

Unpacked Size

88.1 kB

Total Files

47

Last publish

Collaborators

  • malt03