Security News
ESLint is Now Language-Agnostic: Linting JSON, Markdown, and Beyond
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
exif-rotate-js
Advanced tools
When you use input file, you can get base64 string as array without worrying about `orientation` of exif.
When you use input file, you can get base64 string as array without worrying about orientation
of exif.
$ npm install exif-rotate-js
const data = await getBase64Strings(files, {maxSize, type, quality}))
["data:image/jpeg;base64,/9j/4AAQS..."]
files
: input target files. User can select multiple files.maxSize = 720
: canvas max size. When image's width is greater than height, maxSize
applies to width. And vice versa.type = 'image/jpeg'
: the mime type of the generated image. Any mime type supported by HTMLCanvasElement.toDataURL() is supported.quality (optional)
: a number between 0
and 1
indicating the image quality to use for image formats that use lossy compression such as image/jpeg
and image/webp
. If this argument is anything else, the default value for image quality is used. As per the spec, the default (undefined
) value will use 0.92
.import { getBase64Strings } from 'exif-rotate-js';
const elem = document.getElementById('fileImage');
if (elem) {
elem.onchange = async (e) => {
if (!e.target) return;
const data = await getBase64Strings(e.target.files, { maxSize: 1024 });
console.log(data); // ["data:image/jpeg;base64,/9j/4AAQS..."] as type of Array
};
}
FAQs
When you use input file, you can get base64 string as array without worrying about `orientation` of exif.
We found that exif-rotate-js demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
Security News
Members Hub is conducting large-scale campaigns to artificially boost Discord server metrics, undermining community trust and platform integrity.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.