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/08/20 13:03:13 UTC

[GitHub] [cordova-plugin-camera] etiks3 opened a new issue #635: Plugin allows selection of .txt and .pdf but set on "MediaType.PICTURE" - Provider issue

etiks3 opened a new issue #635:
URL: https://github.com/apache/cordova-plugin-camera/issues/635


   # Bug Report
   
   ## Problem
   We have implemented the plugin to upload only "MediaType.PICTURE" media type when selecting a picture form the gallery. However, some of our application users are able to select .txt files instead of pictures in the gallery. When we open the .txt file received the content is as follow:
   `%2Fstorage%2Femulated%2F0%2FEpson%20iPrint%2Farr%C3%AAt%20de%20travail%20.pdf`
   It sounds like the document was created from a scanner and available in the gallery as a .pdf. 
   I don't know which device was used to send the file and i was not able to reproduce such a bug on my Android device.
   
   ### What is expected to happen?
   The application we have built, allows user to send us pictures from their devices. We only authorized picture media type .jpeg or .png.
   
   
   ### What does actually happen?
   On certain cases, users have been able to send .txt files, see Problem section above.
   
   
   
   ## Information
   <!-- Include all relevant information that might help understand and reproduce the problem -->
   
   
   
   ### Command or Code
   Here is the code I've used to select from the gallery or from the camera:
    ```// Get event selector to device camera source type
               self.cameraSrcTypeSelector = function(e) {
                   var eventSrc = e.target;
                   var classListName = eventSrc.classList;
                   var srcType;
                   if (classListName.contains('camera')) {
                       srcType = Camera.PictureSourceType.CAMERA;
                   } else if (classListName.contains('gallery')) {
                       srcType = Camera.PictureSourceType.SAVEDPHOTOALBUM;
                   }
                   pictureManager(srcType);
               };
    ```
   Here are the camera options:
    ```          // Set all options for device camera
               function setCameraOptions(srcType) {
                   var options = {
                       // Some common settings are 20, 50, and 100
                       quality: 50,
                       destinationType: Camera.DestinationType.DATA_URL,
                       // Dynamically set the picture source, Camera or photo gallery
                       sourceType: srcType,
                       encodingType: Camera.EncodingType.JPEG,
                       mediaType: Camera.MediaType.PICTURE,
                       allowEdit: false,
                       correctOrientation: true, //Corrects Android orientation quirks
                       direction: 0 // Ensure back camera is set by default
                   }
                   return options;
               };
    ```
   
   
   
   ### Environment, Platform, Device
   Linux dev environment
   Android and iOS devices (But I suspect it does only happen on Android devices)
   
   ### Version information
   For example:
   Cordova: 9.0.0 (cordova-lib@9.0.1)
   Other Frameworks: Oracle JET 8.2.0
   Operating System: Linux (Centos7)
   Android Studio + XCode to emulate/simulate only
   
   
   
   
   ## 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-camera] etiks3 commented on issue #635: Plugin allows selection of .txt and .pdf but set on "MediaType.PICTURE"

Posted by GitBox <gi...@apache.org>.
etiks3 commented on issue #635:
URL: https://github.com/apache/cordova-plugin-camera/issues/635#issuecomment-667988853


   After investigations, it seems that the fileprovider is causing the problem. I could not reproduce the issue but it seems that if I've used a external file provider to scan a document and select it with the camera plugin, .pdf and .txt files are allowed to be uploaded. We don't want that and restrict the camera plugin to be able to only upload .jpeg, .png. Is there a way to restrict the file provider in the device? Thanks for your answer


----------------------------------------------------------------
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-camera] PieterVanPoyer commented on issue #635: Plugin allows selection of .txt and .pdf but set on "MediaType.PICTURE" - Provider issue

Posted by GitBox <gi...@apache.org>.
PieterVanPoyer commented on issue #635:
URL: https://github.com/apache/cordova-plugin-camera/issues/635#issuecomment-849888769


   @sboudouk  en @etiks3  I am unable to replicate this issue. Seems to be working fine. When setting to select pictures only, I am only able to select images (bmp, gif, jpeg, png, ... ). 
   I will test some more.
   But without steps to reproduce and or a target device it will be difficult to troubleshoot this.


-- 
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-camera] etiks3 closed issue #635: Plugin allows selection of .txt and .pdf but set on "MediaType.PICTURE" - Provider issue

Posted by GitBox <gi...@apache.org>.
etiks3 closed issue #635:
URL: https://github.com/apache/cordova-plugin-camera/issues/635


   


----------------------------------------------------------------
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-camera] etiks3 edited a comment on issue #635: Plugin allows selection of .txt and .pdf but set on "MediaType.PICTURE"

Posted by GitBox <gi...@apache.org>.
etiks3 edited a comment on issue #635:
URL: https://github.com/apache/cordova-plugin-camera/issues/635#issuecomment-674773659


   Hello any news on this thread? It sounds like the plugin allows providers to send .pdf or .txt. A reply would be appreciated, 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


[GitHub] [cordova-plugin-camera] sboudouk commented on issue #635: Plugin allows selection of .txt and .pdf but set on "MediaType.PICTURE" - Provider issue

Posted by GitBox <gi...@apache.org>.
sboudouk commented on issue #635:
URL: https://github.com/apache/cordova-plugin-camera/issues/635#issuecomment-757538494


   Any news on this ? I would like to allow pdf and images (png, jpeg) only. Despite setting the CameraType settings to pictures only, it keeps allowing me to upload everything.
   
   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


[GitHub] [cordova-plugin-camera] etiks3 commented on issue #635: Plugin allows selection of .txt and .pdf but set on "MediaType.PICTURE"

Posted by GitBox <gi...@apache.org>.
etiks3 commented on issue #635:
URL: https://github.com/apache/cordova-plugin-camera/issues/635#issuecomment-674773659


   Hello any news on this thread? 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


[GitHub] [cordova-plugin-camera] PieterVanPoyer commented on issue #635: Plugin allows selection of .txt and .pdf but set on "MediaType.PICTURE" - Provider issue

Posted by GitBox <gi...@apache.org>.
PieterVanPoyer commented on issue #635:
URL: https://github.com/apache/cordova-plugin-camera/issues/635#issuecomment-872521051


   I am closing this issue, because there is not enough information to start working on this.


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

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-camera] PieterVanPoyer closed issue #635: Plugin allows selection of .txt and .pdf but set on "MediaType.PICTURE" - Provider issue

Posted by GitBox <gi...@apache.org>.
PieterVanPoyer closed issue #635:
URL: https://github.com/apache/cordova-plugin-camera/issues/635


   


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

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-camera] etiks3 commented on issue #635: Plugin allows selection of .txt and .pdf but set on "MediaType.PICTURE" - Provider issue

Posted by GitBox <gi...@apache.org>.
etiks3 commented on issue #635:
URL: https://github.com/apache/cordova-plugin-camera/issues/635#issuecomment-677651152


   > Hello any news on this thread? It sounds like the plugin allows providers to send .pdf or .txt. A reply would be appreciated, 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