These are chat archives for angular/angular-2-ionic-2

22nd
Feb 2018
Ghost
@ghost~58a45227d73408ce4f4a8666
Feb 22 2018 13:55

Hi guys, can someone help me please?
How to show cropped image from Ionic and ionic crop plugin? Code I have tried:

return this.camera.getPicture(this.options)
    .then((fileUri) => {
        if (this.platform.is('android')) {
            return this.crop.crop(fileUri).then((path) => {
            this.imgUrl = path;
        });
     }
 });

and

<img [src]="imgUrl" />

Code returns me path, in format: file:///storage/..... but image is not shown.

Jorrit
@jorrit-wehelp
Feb 22 2018 14:42
you have to pass it through the resolveLocalFilesystemUrl function, it should be mentioned somewhere in the docs of the plugin
maxeber
@maxeber
Feb 22 2018 14:48
@UncertaintyP thanks for pointing out some hint, figured out I needed to delete the platforms/android and rebuild it. Now it seems I don't need to delete it anymore and just build.
UncertaintyP
@UncertaintyP
Feb 22 2018 14:57
Good to hear :thumbsup:
Ghost
@ghost~58a45227d73408ce4f4a8666
Feb 22 2018 15:17
@jorrit-wehelp is this what I need or not? https://ionicframework.com/docs/native/file/
Jorrit
@jorrit-wehelp
Feb 22 2018 15:19
yep
Ghost
@ghost~58a45227d73408ce4f4a8666
Feb 22 2018 15:23
@jorrit-wehelp thanks man. I hope that helps