Hi,
I’m using the Image Resizer ( https://ionicframework.com/docs/native/image-resizer/ ) to resize images before uploading to my server. The resizing works fine on Android, but when on iOS the resizer loses the ratio of the image. I’m getting a resized image with the height and width as I define in de ImageResizeOptions (1280x1280).
const resizeOptions: ImageResizerOptions = {
height: 1280,
quality: 80,
uri: orgSrc,
width: 1280,
};
this.platform.is("android") ?
resizeOptions.folderName = "uploadTmp" :
resizeOptions.fileName = this.fileName;
this.imgResizer.resize(resizeOptions)
.then((filePath: string) => {
this.resizedPreviewImgSrc = normalizeURL(filePath);
this.resizedSrc = filePath;
console.log("FilePath:", filePath);
resolve();
})
.catch((e) => {
reject(e);
});
Am I missing some options or am I using wrong options? Why does it take the height / width as max and keeps it’s ratio on Android, but does it lose it’s ratio when using on iOS? Any ideas?
Please advice…
B