Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Andoid Chrome browser freezes when using compress #32

Open
shubhpy opened this issue Jun 20, 2018 · 3 comments
Open

Andoid Chrome browser freezes when using compress #32

shubhpy opened this issue Jun 20, 2018 · 3 comments

Comments

@shubhpy
Copy link

shubhpy commented Jun 20, 2018

In my android phone of 4GB ram, when I upload an image and compress it using below code

onImageChange(event) {
  let image = event.target.files[0];

  this.ng2ImgMax.compressImage(image, 0.25).subscribe(
    result => {
      this.uploadedImage = new File([result], result.name);
      this.getImagePreview(this.uploadedImage);
    },
    error => {
      console.log('😢 Oh no!', error);
    }
  );
}

Referenced from this article: https://alligator.io/angular/resizing-images-in-browser-ng2-img-max/ Compress Instead of Resizing

When uploading an image of 3.5 MB, getting the compressed image of 200-500 kb. That is good but the browser is freezing for 8-15 secs.

Though this is not an issue in laptop or desktop browser.

@kctang
Copy link

kctang commented Jul 6, 2018

I am considering to use this package on a Cordova application but this issue worries me. Have you found a solution for this on mobile?

@shubhpy
Copy link
Author

shubhpy commented Jul 15, 2018

Yea My colleague https://github.com/Shwshank found the solution. Ping him.

@Shwshank
Copy link

Shwshank commented Sep 15, 2018

npm package : ng2-image-compress works fine for me (with some config)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants