You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "breautek (via GitHub)" <gi...@apache.org> on 2024/10/26 00:54:04 UTC
[PR] fix(android): Return data uris as an URI [cordova-plugin-camera]
breautek opened a new pull request, #910:
URL: https://github.com/apache/cordova-plugin-camera/pull/910
<!--
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
Android
### Motivation and Context
<!-- Why is this change required? What problem does it solve? -->
<!-- If it fixes an open issue, please link to the issue here. -->
Makes data urls returned as actual URIs instead of just the base 64 encoded data.
This sisters PR https://github.com/apache/cordova-plugin-camera/pull/902
Closes https://github.com/apache/cordova-plugin-camera/issues/420
### Description
<!-- Describe your changes in detail -->
Prefixes the base64 with the data uri header.
### Testing
<!-- Please describe in detail how you tested your changes. -->
paramedic tests passes
Manual testing
### Checklist
- [x] I've run the tests to see all new and existing tests pass
- [x] I added automated test coverage as appropriate for this change
- [x] Commit is prefixed with `(platform)` if this change only applies to one platform (e.g. `(android)`)
- [x] 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/))
- [x] 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
Re: [PR] fix(android): Return data uris as an URI [cordova-plugin-camera]
Posted by "jcesarmobile (via GitHub)" <gi...@apache.org>.
jcesarmobile commented on PR #910:
URL: https://github.com/apache/cordova-plugin-camera/pull/910#issuecomment-2439683927
Doesn’t really fully closes https://github.com/apache/cordova-plugin-camera/issues/420, this only changes the behavior for android, but iOS and browser are still “broken”
--
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
Re: [PR] fix(android): Return data uris as an URI [cordova-plugin-camera]
Posted by "erisu (via GitHub)" <gi...@apache.org>.
erisu commented on code in PR #910:
URL: https://github.com/apache/cordova-plugin-camera/pull/910#discussion_r1817523693
##########
src/android/CameraLauncher.java:
##########
@@ -1291,11 +1291,12 @@ public void processPicture(Bitmap bitmap, int encodingType) {
try {
if (bitmap.compress(compressFormat, mQuality, jpeg_data)) {
+ StringBuilder sb = new StringBuilder();
+ sb.append("data:image/jpeg;base64,");
Review Comment:
I believe the `encodingType` that is passed into `processPicture` could be either `JPG` or `PNG`.
Maybe use `getMimetypeForEncodingType` to get the correct mime type? It should return `PNG_MIME_TYPE` (`image/png`) for `PNG` or `JPEG_MIME_TYPE` (`image/jpeg`) for `JPEG`.
--
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
Re: [PR] fix(android): Return data uris as an URI [cordova-plugin-camera]
Posted by "breautek (via GitHub)" <gi...@apache.org>.
breautek commented on code in PR #910:
URL: https://github.com/apache/cordova-plugin-camera/pull/910#discussion_r1817653142
##########
src/android/CameraLauncher.java:
##########
@@ -1291,11 +1291,12 @@ public void processPicture(Bitmap bitmap, int encodingType) {
try {
if (bitmap.compress(compressFormat, mQuality, jpeg_data)) {
+ StringBuilder sb = new StringBuilder();
+ sb.append("data:image/jpeg;base64,");
Review Comment:
lol, i just assumed it was jpeg since the variable was called jpeg_data... but yah it does seem to potentially be png
--
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
Re: [PR] fix(android): Return data uris as an URI [cordova-plugin-camera]
Posted by "breautek (via GitHub)" <gi...@apache.org>.
breautek merged PR #910:
URL: https://github.com/apache/cordova-plugin-camera/pull/910
--
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
Re: [PR] fix(android): Return data uris as an URI [cordova-plugin-camera]
Posted by "breautek (via GitHub)" <gi...@apache.org>.
breautek commented on PR #910:
URL: https://github.com/apache/cordova-plugin-camera/pull/910#issuecomment-2439700694
Yah, it will be covered by https://github.com/apache/cordova-plugin-camera/pull/911 and https://github.com/apache/cordova-plugin-camera/pull/912
--
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