New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@mish-tv/fix-image-orientation

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mish-tv/fix-image-orientation

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

0.0.1
latest
Source
npm
Version published
Weekly downloads
107
-26.21%
Maintainers
1
Weekly downloads
 
Created
Source

@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

Keywords

image

FAQs

Package last updated on 03 Aug 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts