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

Getting ENCODING_ERR in ios #257

Open
suraj092kumar opened this issue Jan 9, 2018 · 3 comments
Open

Getting ENCODING_ERR in ios #257

suraj092kumar opened this issue Jan 9, 2018 · 3 comments

Comments

@suraj092kumar
Copy link

on selecting image in ios getting FileError
code: 5
message: "ENCODING_ERR"

@yoojene
Copy link

yoojene commented Jan 25, 2018

I got this too, looks like for iOS only the device-absolute-file-location is being returned

Worked around by appending a file URI

this.imagePicker.getPictures(options).then(
      res => {
        for (let i = 0; i < res.length; i++) {
          console.log('Image URI: ' + res[i]);
          let fullPath;
          if (this.plt.is('ios')) {
            fullPath = 'file://' + res[i];
          } else {
            fullPath = res[i];
          }

@Nightbr
Copy link

Nightbr commented Mar 29, 2018

Hey, it seems we have the same issue, do you have any robust solution for this? Because it will bug in older version of iOS which already have file://...

Any idea?

@Nightbr
Copy link

Nightbr commented Apr 2, 2018

@yoojene I tried this

       if(ionic.Platform.isIOS()){
            if(uri.indexOf('file://') == -1){
                uri = 'file://'+uri;
            }
        }

But I still have a blank image on iOS 11 when I tried to pass the uri to $jrCrop :/

I will dig deeper on this because the same code works great on Android...

https://github.com/JrSchild/jr-crop

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

3 participants