deej81 / ngx-croppie

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`src.match` is not a function

AILazerka opened this issue · comments

What?

When uploading image and trying to scroll or move slider for zoom size is adjusted but there are lots of errors in the browser console regarding the failing url check: src.match is not a function

Versions

latest ngx-croppie (3.0.0)
croppie version (2.6.3-2.6.4)

Steps to reproduce

  1. Checkout https://github.com/mainawycliffe/cropped-image-form-control-in-angular-demo
  2. Upgrade to use latest ngx-croppie (3.0.0) and compatible croppie version (2.6.3-2.6.4)
  3. Build and run app
  4. Upload test image using blob type-based upload selector
  5. Scroll over the image to change side
  6. Checkout console error

Hi! The problem is that in your image-control you are passing back to croppie the image that is returning as a Blob, and a Blob does not have the .match function, is not a string. You should store the result in another field. The performance should be better too.

newImageResultFromCroppie(img: string) {
    **this.croppieImage** = img;
    this.propagateChange(this.croppieImage);
  }