jpegasus
v1.16.1
Published
A client-side JavaScript tool that takes in a `File` of type `.jpeg`, `.png`, or `.gif` and returns a compressed `File` of type `.jpeg`.
Downloads
1,690
Readme
jpegasus
A client-side JavaScript tool that takes in a File
of type .jpeg
, .png
, or .gif
and returns a compressed File
of type .jpeg
. It's as easy as taking out the trash! 🗑
Implementation example
Code example
const jpegasus = require('jpegasus');
function processFile(file) {
return jpegasus.compress(file, {
maxHeight: 1000,
maxWidth: 1000,
quality: 0.65
});
}
module.exports = {
processFile
};
Documentation
compress(file
: File, inputOptions
: InputOptions): Promise‹File | Blob›
determineOrientation(file
: File | Blob): Promise‹number›
Caution
- Note that when the
preserveFileType
option istrue
, thequality
option will only work for files such asimage/jpeg
andimage/webp
per the MDN web docs here.
Feedback
Do you have an idea for making jpegasus better? Add your idea under the issues tab, we'd love to hear about it!
Contributors
Thanks goes to these wonderful people:
| Tony Brobston💻 | KANG🎨 💻 | lounsbrough💻 | Tate Button🤔 | | :---: | :---: | :---: | :---: |