In this example I am using the filetype option as .png
but its not working as expected.
import imageCompression from 'browser-image-compression';
const compressImage = async (pic) => {
const options = {
maxSizeMB: 1,
maxWidthOrHeight: 1024,
useWebWorker: true,
fileType: '.png',
};
const compressedPic = await imageCompression(pic, options);
console.log('compressed', compressedPic.size);
console.log('compressd pic title', compressedPic.name);
};