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 2021/12/21 06:37:06 UTC

[GitHub] [cordova-android] kortgat opened a new pull request #1385: (platform)feat: Added camera select to file input tags

kortgat opened a new pull request #1385:
URL: https://github.com/apache/cordova-android/pull/1385


   <!--
   Please make sure the checklist boxes are all checked before submitting the PR. The checklist is intended as a quick reference, for complete details please see our Contributor Guidelines:
   
   http://cordova.apache.org/contribute/contribute_guidelines.html
   
   Thanks!
   -->
   
   ### Platforms affected
   
   
   
   ### Motivation and Context
   <!-- Why is this change required? What problem does it solve? -->
   Allowing the user to use the camera or file browser with a html file input tag
   
   <!-- If it fixes an open issue, please link to the issue here. -->
   [https://github.com/apache/cordova-android/issues/816](https://github.com/apache/cordova-android/issues/816)
   
   
   
   ### Description
   <!-- Describe your changes in detail -->
   Reworked the action tray to use a chooser intent in cordova\engine\SystemWebChromeClient.java to add option for the camera
   
   
   
   ### Testing
   <!-- Please describe in detail how you tested your changes. -->
   Tested using a emulator and actual device to take photos and upload to my server as well as upload pdf files from file system.
   I am also currently using this in production in my application.
   
   
   ### Checklist
   
   - [ ] I've run the tests to see all new and existing tests pass
   - [ ] I added automated test coverage as appropriate for this change
   - [ ] Commit is prefixed with `(platform)` if this change only applies to one platform (e.g. `(android)`)
   - [ ] If this Pull Request resolves an issue, I linked to the issue in the text above (and used the correct [keyword to close issues using keywords](https://help.github.com/articles/closing-issues-using-keywords/))
   - [ ] I've updated the documentation if necessary
   


-- 
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-android] Djones4822 edited a comment on pull request #1385: (android)feat: Added camera select to file input tags

Posted by GitBox <gi...@apache.org>.
Djones4822 edited a comment on pull request #1385:
URL: https://github.com/apache/cordova-android/pull/1385#issuecomment-1068396055


   I was using your hotfix.zip archive to hook the camera intent, I noticed that the pictures being uploaded were unusually small - only 150x200px. I believe this is because you are accessing the "thumbnail data" instead of the full picture data.
   
   I base this on the sample code provided in the android documentation here: https://developer.android.com/training/camera/photobasics#java
   
   Within the `onActivityResult()` definition, you define `Bundle bundle = data.getExtras();` on line 288, and then on line 313 you create the bitmap using `Bitmap bmp = (Bitmap) bundle.get("data");` - this is exactly how they access the thumbnail with the warning "Note: This thumbnail image from "data" might be good for an icon, but not a lot more. Dealing with a full-sized image takes a bit more work. "
   
   I will update as I continue research. Thanks for your work toward this problem! 
   
   edit: I think this is due to line 258 being commented out, and then the compressed thumbnail being written to the output path. However, uncommenting 258 and commenting out 313-318 causes the camera to crash after clicking "OK" - not sure why. Still researching...


-- 
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-android] nishizbdjy commented on pull request #1385: (android)feat: Added camera select to file input tags

Posted by GitBox <gi...@apache.org>.
nishizbdjy commented on pull request #1385:
URL: https://github.com/apache/cordova-android/pull/1385#issuecomment-1054921474


   > ### Platforms affected
   > ### Motivation and Context
   > Allowing the user to use the camera or file browser with a html file input tag
   > 
   > #816
   > 
   > ### Description
   > Reworked the action tray to use a chooser intent in cordova\engine\SystemWebChromeClient.java to add option for the camera
   > 
   > ### Testing
   > Tested using a emulator and actual device to take photos and upload to my server as well as upload pdf files from file system. I am also currently using this in production in my application.
   > 
   > ### Checklist
   > * [ ]  I've run the tests to see all new and existing tests pass
   > * [ ]  I added automated test coverage as appropriate for this change
   > * [ ]  Commit is prefixed with `(platform)` if this change only applies to one platform (e.g. `(android)`)
   > * [ ]  If this Pull Request resolves an issue, I linked to the issue in the text above (and used the correct [keyword to close issues using keywords](https://help.github.com/articles/closing-issues-using-keywords/))
   > * [ ]  I've updated the documentation if necessary
   
   
   
   > ### Platforms affected
   > ### Motivation and Context
   > Allowing the user to use the camera or file browser with a html file input tag
   > 
   > #816
   > 
   > ### Description
   > Reworked the action tray to use a chooser intent in cordova\engine\SystemWebChromeClient.java to add option for the camera
   > 
   > ### Testing
   > Tested using a emulator and actual device to take photos and upload to my server as well as upload pdf files from file system. I am also currently using this in production in my application.
   > 
   > ### Checklist
   > * [ ]  I've run the tests to see all new and existing tests pass
   > * [ ]  I added automated test coverage as appropriate for this change
   > * [ ]  Commit is prefixed with `(platform)` if this change only applies to one platform (e.g. `(android)`)
   > * [ ]  If this Pull Request resolves an issue, I linked to the issue in the text above (and used the correct [keyword to close issues using keywords](https://help.github.com/articles/closing-issues-using-keywords/))
   > * [ ]  I've updated the documentation if necessary
   
   


-- 
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-android] nishizbdjy commented on pull request #1385: (android)feat: Added camera select to file input tags

Posted by GitBox <gi...@apache.org>.
nishizbdjy commented on pull request #1385:
URL: https://github.com/apache/cordova-android/pull/1385#issuecomment-1054922203


   After I follow your changes, I can choose the camera, but I don't know why the photos are blurry.


-- 
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-android] nishizbdjy removed a comment on pull request #1385: (android)feat: Added camera select to file input tags

Posted by GitBox <gi...@apache.org>.
nishizbdjy removed a comment on pull request #1385:
URL: https://github.com/apache/cordova-android/pull/1385#issuecomment-1054921474


   > ### Platforms affected
   > ### Motivation and Context
   > Allowing the user to use the camera or file browser with a html file input tag
   > 
   > #816
   > 
   > ### Description
   > Reworked the action tray to use a chooser intent in cordova\engine\SystemWebChromeClient.java to add option for the camera
   > 
   > ### Testing
   > Tested using a emulator and actual device to take photos and upload to my server as well as upload pdf files from file system. I am also currently using this in production in my application.
   > 
   > ### Checklist
   > * [ ]  I've run the tests to see all new and existing tests pass
   > * [ ]  I added automated test coverage as appropriate for this change
   > * [ ]  Commit is prefixed with `(platform)` if this change only applies to one platform (e.g. `(android)`)
   > * [ ]  If this Pull Request resolves an issue, I linked to the issue in the text above (and used the correct [keyword to close issues using keywords](https://help.github.com/articles/closing-issues-using-keywords/))
   > * [ ]  I've updated the documentation if necessary
   
   
   
   > ### Platforms affected
   > ### Motivation and Context
   > Allowing the user to use the camera or file browser with a html file input tag
   > 
   > #816
   > 
   > ### Description
   > Reworked the action tray to use a chooser intent in cordova\engine\SystemWebChromeClient.java to add option for the camera
   > 
   > ### Testing
   > Tested using a emulator and actual device to take photos and upload to my server as well as upload pdf files from file system. I am also currently using this in production in my application.
   > 
   > ### Checklist
   > * [ ]  I've run the tests to see all new and existing tests pass
   > * [ ]  I added automated test coverage as appropriate for this change
   > * [ ]  Commit is prefixed with `(platform)` if this change only applies to one platform (e.g. `(android)`)
   > * [ ]  If this Pull Request resolves an issue, I linked to the issue in the text above (and used the correct [keyword to close issues using keywords](https://help.github.com/articles/closing-issues-using-keywords/))
   > * [ ]  I've updated the documentation if necessary
   
   


-- 
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-android] Djones4822 edited a comment on pull request #1385: (android)feat: Added camera select to file input tags

Posted by GitBox <gi...@apache.org>.
Djones4822 edited a comment on pull request #1385:
URL: https://github.com/apache/cordova-android/pull/1385#issuecomment-1068396055


   I was using your hotfix.zip archive to hook the camera intent, I noticed that the pictures being uploaded were unusually small - only 150x200px. I believe this is because you are accessing the "thumbnail data" instead of the full picture data.
   
   I base this on the sample code provided in the android documentation here: https://developer.android.com/training/camera/photobasics#java
   
   Within the `onActivityResult()` definition, you define `Bundle bundle = data.getExtras();` on line 288, and then on line 313 you create the bitmap using `Bitmap bmp = (Bitmap) bundle.get("data");` - this is exactly how they access the thumbnail with the warning 
   
   I will update as I continue research. Thanks for your work toward this problem! 


-- 
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-android] Djones4822 edited a comment on pull request #1385: (android)feat: Added camera select to file input tags

Posted by GitBox <gi...@apache.org>.
Djones4822 edited a comment on pull request #1385:
URL: https://github.com/apache/cordova-android/pull/1385#issuecomment-1068396055


   I was using your hotfix.zip archive to hook the camera intent, I noticed that the pictures being uploaded were unusually small - only 150x200px. I believe this is because you are accessing the "thumbnail data" instead of the full picture data.
   
   I base this on the sample code provided in the android documentation here: https://developer.android.com/training/camera/photobasics#java
   
   Within the `onActivityResult()` definition, you define `Bundle bundle = data.getExtras();` on line 288, and then on line 313 you create the bitmap using `Bitmap bmp = (Bitmap) bundle.get("data");` - this is exactly how they access the thumbnail with the warning "Note: This thumbnail image from "data" might be good for an icon, but not a lot more. Dealing with a full-sized image takes a bit more work. "
   
   I will update as I continue research. Thanks for your work toward this problem! 
   
   edit: I think this is due to line 258 being commented out, and then the compressed thumbnail being written to the output path. However, uncommenting 258 and commenting out 313-318 causes the camera to crash after clicking "OK" - not sure why. Still researching...
   
   edit2: unfortunately I'm hitting a wall with my understanding of the android java classes, but maybe the issue is not that the app is crashing, but that the URI being passed isn't valid? I might stop here for now, would really love any feedback from someone more familiar with the android backend! 


-- 
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-android] Djones4822 edited a comment on pull request #1385: (android)feat: Added camera select to file input tags

Posted by GitBox <gi...@apache.org>.
Djones4822 edited a comment on pull request #1385:
URL: https://github.com/apache/cordova-android/pull/1385#issuecomment-1068396055


   I was using your hotfix.zip archive to hook the camera intent, I noticed that the pictures being uploaded were unusually small - only 150x200px. I believe this is because you are accessing the "thumbnail data" instead of the full picture data.
   
   I base this on the sample code provided in the android documentation here: https://developer.android.com/training/camera/photobasics#java
   
   Within the `onActivityResult()` definition, you define `Bundle bundle = data.getExtras();` on line 288, and then on line 313 you create the bitmap using `Bitmap bmp = (Bitmap) bundle.get("data");` - this is exactly how they access the thumbnail with the warning "Note: This thumbnail image from "data" might be good for an icon, but not a lot more. Dealing with a full-sized image takes a bit more work. "
   
   I will update as I continue research. Thanks for your work toward this problem! 


-- 
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-android] Djones4822 commented on pull request #1385: (android)feat: Added camera select to file input tags

Posted by GitBox <gi...@apache.org>.
Djones4822 commented on pull request #1385:
URL: https://github.com/apache/cordova-android/pull/1385#issuecomment-1068396055


    was using your hotfix.zip archive to hook the camera intent, I noticed that the pictures being uploaded were unusually small - only 150x200px. I believe this is because you are accessing the "thumbnail data" instead of the full picture data.
   
   I base this on the sample code provided in the android documentation here: https://developer.android.com/training/camera/photobasics#java
   
   Within the `onActivityResult()` definition, you define `Bundle bundle = data.getExtras();` on line 288, and then on line 313 you create the bitmap using `Bitmap bmp = (Bitmap) bundle.get("data");` - this is exactly how they access the thumbnail with the warning 
   
   I will update as I continue research. Thanks for your work toward this problem! 


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