@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.
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;
});
});
</script>
Supported Format
If an unsupported format is received, it returns dataURL without processing.
Installation
npm install --save @mish-tv/fix-image-orientation