1.0.4 • Published 5 months ago

@prmichaelsen/fix-image-orientation v1.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

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 @prmichaelsen/fix-image-orientation
1.0.2

5 months ago

1.0.4

5 months ago

1.0.3

5 months ago

1.0.1

5 months ago

1.0.0

5 months ago

0.0.1

6 months ago