nicam / js-resize

Client Size Image resizing demo
58 stars 34 forks source link

Chrome High RAM Usage when resizing multiple images #4

Closed kx-chen closed 5 years ago

kx-chen commented 5 years ago

Currently resizing multiple images to display, however, RAM usage goes through the roof on Chrome: Screen Shot 2019-08-08 at 9 05 16 PM

This is how I'm using it (simplified):

    addImage(e) {
      const files = Array.from(e.target.files);
      files.forEach((file) => {
           Resizer.imageFileResizer(
                file,
                300,
                300,
                'JPEG',
                100,
                0,
                uri => {
                    console.log(uri);
                },
                'base64'
            );

        });
    }

Any ideas? I've already tried modifying the library code to remove instances of Image and the canvas after getting the resized uri, however RAM usage is still extremely high.

This doesn't happen on Safari. Any ideas would be appreciated. :)

kx-chen commented 5 years ago

Apologies, wrong repository 🤦‍♂