Horje
react image compression Code Example
react image compression
import imageCompression from "browser-image-compression";

export const lighterImage = (file) => {
  return new Promise(function (resolve, reject) {
    var options = {
      maxSizeMB: 0.5,
      maxWidthOrHeight: 800,
      useWebWorker: true,
    };
    imageCompression(file, options)
      .then(function (compressedFile) {
        resolve(compressedFile);
        // resolve compresed file
      })
      .catch(function (error) {
        reject(error);
      });
  });
};




Javascript

Related
javascript recursive on object of arrays Code Example javascript recursive on object of arrays Code Example
join two arrays in js Code Example join two arrays in js Code Example
append to a div and save the previous data after refresh page  in javascript Code Example append to a div and save the previous data after refresh page in javascript Code Example
column chart in js Code Example column chart in js Code Example
10.4.2. Functions // Default Value Code Example 10.4.2. Functions // Default Value Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
9