imageResizer not work


#1

hello, i am hector from argentina. i am programming in ionic but the plugin imageResizer not work.
this is the code of home.ts where is implemented the resizer.

import { Component } from ‘@angular/core’;
import { NavController } from ‘ionic-angular’;
import { FileChooser } from ‘@ionic-native/file-chooser’;
import { FilePath } from ‘@ionic-native/file-path’;
import { Crop } from ‘@ionic-native/crop’;
import { ImageResizer, ImageResizerOptions } from ‘@ionic-native/image-resizer’;
import { File } from ‘@ionic-native/file’;
import { Base64 } from ‘@ionic-native/base64’;

@Component({
selector: ‘page-home’,
templateUrl: ‘home.html’
})
export class HomePage {
imagencut: any;
image:string=’’;
imageSP:string=’’;
imagenPath:string=’’;
imageBase64:string=’’;

options: any = {
uri: this.imagencut,
quality: 90,
width: 100,
height: 100
} as ImageResizerOptions;

constructor(public navCtrl: NavController, private fileChooser: FileChooser, private filePath: FilePath,
private crop: Crop, private imageResizer: ImageResizer, private file: File, private base64: Base64) {

}
choose() {

this.fileChooser.open()
  .then(uri => this.imageSP = uri)
  .catch(e => console.log(e));

setTimeout(this.filePath.resolveNativePath(this.imageSP)
.then(filePath => this.imagenPath = filePath)
.catch(err => console.log(err)),6000);
}

mostrar(){
alert("imagenSP: " + this.imageSP);
alert("imagenpath: " + this.imagenPath);
alert("image: " + this.image);
// alert("imagebase64: " + this.imageBase64);

}

cortar(){
this.crop.crop(this.imagenPath, {quality: 15})
.then(
newImage => this.imagencut = newImage),
error => console.error(‘Error cropping image’, error)
alert(“la nueva imagen:” + this.image);
this.image = this.imagencut;
}
original(){
this.image = this.imagenPath;
}
base(){
this.base64.encodeFile(this.imagencut).then((base64File: string) => {
this.imageBase64 = base64File;
}, (err) => {
alert(err);
});
alert(“termino al fin”);
}
resize(){
this.imageResizer
.resize(this.options)
.then(filePath => this.image = filePath)
.catch(e => alert(e));
}
}

the function resize is calls from a button from home.html before of choose an image from the gallery