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! 🗑
const jpegasus = require('jpegasus');
function processFile(file) {
return jpegasus.compress(file, {
maxHeight: 1000,
maxWidth: 1000,
quality: 0.65
});
}
module.exports = {
processFile
};
compress(file
: File, inputOptions
: InputOptions): Promise‹File | Blob›
determineOrientation(file
: File | Blob): Promise‹number›
preserveFileType
option is true
, the quality
option will only work for files such as image/jpeg
and image/webp
per the MDN web docs here.Do you have an idea for making jpegasus better? Add your idea under the issues tab, we'd love to hear about it!
Thanks goes to these wonderful people:
Tony Brobston 💻 |
KANG 🎨 💻 |
lounsbrough 💻 |
Tate Button 🤔 |
---|