You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2020/10/13 07:07:35 UTC

[GitHub] [cordova-plugin-file] Zerokk opened a new issue #429: Silent error when trying to read image file

Zerokk opened a new issue #429:
URL: https://github.com/apache/cordova-plugin-file/issues/429


   # Bug Report
   
   ## Problem
   
   I'm having problems with this plugin to read images. My idea is to read an image file and convert it to Base64, but I can't read that image no matter what I do. These images are stored by the "Crop" plugin in the directory `Android\data\com.mycompany.myapp\cache`, and they actually reach there, but cannot be read by this plugin.
   
   ### What is expected to happen?
   
   The "File" plugin should correctly read the picture's data, or throw an error. 
   
   
   ### What does actually happen?
   
   It instead throws a silent error which stops execution, but doesn't crash the app.
   
   
   ## Information
   I explained the problem in further detail [in this StackOverflow question](https://stackoverflow.com/questions/64328501/silent-error-when-using-ionic-natives-file-plugin).
   
   
   
   ### Command or Code
   
   `  const base64 = await this.file.readAsDataURL(filePath, imageName);`
   
   Once you reach this line, nothing shows up. The code won't continue executing, and it won't throw any exception, even if wrapped inside a try-catch. Nonetheless, the plugin *seems* to work, as it correctly finds the image it has to read, using this line and returning "true":
   
   `const imageExists = await this.file.checkFile(filePath, imageName)`
   
   
   ### Environment, Platform, Device
   Xiaomi Pocophone F2
   
   
   
   ### Version information
   <!-- 
   What are relevant versions you are using?
   For example:
   Capacitor (2.2.0)
   Other Frameworks: Ionic Framework, Ionic Cli 6.11.1
   Operating System: Windows 10
   -->
   
   
   
   ## Checklist
   <!-- Please check the boxes by putting an x in the [ ] like so: [x] -->
   
   - [x] I searched for existing GitHub issues
   - [x] I updated all Cordova tooling to most recent version
   - [x] I included all the necessary information above
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-plugin-file] breautek closed issue #429: Silent error when trying to read image file

Posted by GitBox <gi...@apache.org>.
breautek closed issue #429:
URL: https://github.com/apache/cordova-plugin-file/issues/429


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-plugin-file] breautek commented on issue #429: Silent error when trying to read image file

Posted by GitBox <gi...@apache.org>.
breautek commented on issue #429:
URL: https://github.com/apache/cordova-plugin-file/issues/429#issuecomment-830845371


   Cordova doesn't implement a promise-based API, so I cannot comment why it's not resolving. 
   
   Encoding base 64 urls on images can be extremely expensive (images can be upwards of 10mb-20mb in file size on some devices when configured to use high resolution when binary encoded, and can grow by 30% when creating a base64 encoded string, which can lock up a modern device for a short period of time. So in general I'd advise against using base64 encodings unless you can guarantee that you are working with small bits of data.
   
   This doesn't seem to be a bug so I'll be closing this issue. If you require more support on this issue, please use our [Slack](http://slack.cordova.io/). Thanks.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org