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

Failed to resize an image on iOS 12.x #61

Open
ryaa opened this issue Oct 25, 2018 · 1 comment
Open

Failed to resize an image on iOS 12.x #61

ryaa opened this issue Oct 25, 2018 · 1 comment

Comments

@ryaa
Copy link

ryaa commented Oct 25, 2018

When trying to resize an image on iOS 12.x no errors shown but the resized image is empty (just white background).
The problem seems to be due to the path assets-library:// which is not supported (for example "assets-library://asset/asset.JPG?id=8458AC82-B00F-4595-8B78-A135643A3AB3&ext=JPG")

Using cordova file plugin and window.resolveLocalFileSystemURL to convert the file to cdv file path seems to fix the problem and the image is resized correctly.

@KokilaBawankar
Copy link

I am also facing the issue when resizing image using the Ionic ImageResizer plugin on iPhone. App gets crashed and no error printed in the console. Here is my code -
compressImage(fileUri: string){
return new Promise((resolve, reject)=>{
console.log('######', fileUri);
let options: ImageResizerOptions = {
uri: fileUri,
folderName: this.file.externalDataDirectory,
quality: 50,
width: 1280,
height: 1280,
base64: true
} ;

  this.imageResizer.resize(options)
    .then((data: string) => {
      console.log('imageResizer FilePath', data);
      return resolve(data);
    })
    .catch(e => {
      console.log('imageResizer error', e);
      return reject(e);
    });
});

}

When this.imageResizer.resize(options) methods is called the app gets crashed. This is happening on iPhone5. I haven't tested it on other iPhones.

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

No branches or pull requests

2 participants