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/02/22 15:55:45 UTC

[GitHub] [cordova-plugin-camera] CGS38 opened a new issue #711: getPicture heic to jpeg support on Samsung Android phones

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


   <!--
   Please have a look at the issue templates you get when you click "New issue" in the GitHub UI.
   We very much prefer issues created by using one of these templates.
   -->
   
   ### Issue Type
   <!-- Please check the boxes by putting an x in the [ ] like so: [x] -->
   
   - [x] Bug Report
   - [x] Feature Request
   - [ ] Support Question
   
   ## Description
   heic format is used by default by many Samsung camera. 
   But this format is not compatible with webview component. 
   The 'encodingType: Camera.EncodingType.JPEG' param in the navigator.camera.getPicture method does not convert heic image to jpeg.
   
   ## Information
   <!-- Include all relevant information that might help understand and reproduce the problem -->
   
   ### Command or Code
   navigator.camera.getPicture(image_lib.onPhotoURISuccess,image_lib.onFailPhoto, 
   				                              { quality: 100,
   								targetWidth: width,
   								targetHeight: height,
                                                                    **encodingType: Camera.EncodingType.JPEG,**									
   				                                destinationType: Camera.DestinationType.FILE_URI,
   				                                correctOrientation : true,
   				                                sourceType: Camera.PictureSourceType.PHOTOLIBRARY });
   
   ### Environment, Platform, Device
   Android 10 , SM-A307FN
   
   
   
   ### Version information
   Cordova v10 Android v9
   Camera plugin version 5.0.1
   
   
   
   
   ## Checklist
   <!-- Please check the boxes by putting an `x` in the `[ ]` like so: `[x]` -->
   
   - [x] I searched for already existing GitHub issues about this
   - [x] I updated all Cordova tooling to their 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] SnpDeveloper commented on issue #711: getPicture heic to jpeg support on Samsung Android phones

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


   I am also looking for a workarround... any suggestions??


-- 
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] SnpDeveloper commented on issue #711: getPicture heic to jpeg support on Samsung Android phones

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


   Thanks @PieterVanPoyer looks much cleaner code. I shall give a go and let you know tomorrow. 
   
   I havent seen the full changes yet. But one thing noticed in old code when mimeType was video or png it used return as filepath rather than file:///... i shall give a full check again and confirm all works expected.
   
   Thanks again for quick turn arround. 


-- 
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] SnpDeveloper commented on issue #711: getPicture heic to jpeg support on Samsung Android phones

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


   Thanks @PieterVanPoyer I have tested heic conversion, all seems to work fine. 
   
   But here are some of my observations, feel free to comment my thoughts
   
   1. bitmap conversion does a very excellent job. 
   	It converts GIF, BMP, JPG, PNG, HEIC to desired format (JPG in mycase)
   	It doesnt convert TIF, HEIF formats.
   	
   2. While failing to convert on bitmap I am getting a clear exception (App is not crashing, again as i would except and a good thing) so easy for me to show File format not support error message in my app.
   
   New changes you have made make sense preseving the encoding mimeType (JPG) extension.. a nice touch.
   
   What i dont understand is why we are restricting support only to JPG, PNG and HEIC, as mentioned before GIF, BMP, JPG, PNG, HEIC formats are all working.
   
   Correct me if I have missed anything.
   


-- 
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] SnpDeveloper commented on issue #711: getPicture heic to jpeg support on Samsung Android phones

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


   Only way i was able to achieve / make heic file type to convert jpeg is modifying CameraLauncher.java
   
   Line 718:
   ` if (this.mediaType == VIDEO || !(JPEG_MIME_TYPE.equalsIgnoreCase(mimeType) || PNG_MIME_TYPE.equalsIgnoreCase(mimeType))) { `
   
   To
   `if (this.mediaType == VIDEO && !(JPEG_MIME_TYPE.equalsIgnoreCase(mimeType))) {`
   
   There should be a better way... for me this helped..
   
   
   
   


-- 
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] SnpDeveloper edited a comment on issue #711: getPicture heic to jpeg support on Samsung Android phones

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


   Thanks @PieterVanPoyer I have tested heic conversion, all seems to work fine. 
   
   But here are some of my observations, feel free to comment my thoughts
   
   1. bitmap conversion does a very excellent job. 
   	It converts GIF, BMP, JPG, PNG, HEIC to desired format (JPG in mycase)
   	
   2. While failing to convert (TIF, HEIF formats) I am getting a clear exception - App is not crashing (again as i would except and a good thing) so easy for me to show File format not support error message in my app.
   
   New changes you have made make sense preseving the encoding mimeType (JPG) extension.. a nice touch.
   
   What i dont understand is why we are restricting support only to JPG, PNG and HEIC, as mentioned before GIF, BMP, JPG, PNG, HEIC formats are all working.
   
   Some of my customer's upload BMP and GIF as well... 
   
   Correct me if I have missed anything.
   


-- 
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] SnpDeveloper commented on issue #711: getPicture heic to jpeg support on Samsung Android phones

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


   In my local testing with Samsung device uploaded image size got compressed didnt give me any error or crash. 


-- 
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 #711: getPicture heic to jpeg support on Samsung Android phones

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


   You could try my branche for testing purposes.
   
   ```
   npx cordova plugin add https://github.com/PieterVanPoyer/cordova-plugin-camera/#feature/issue-711-heif-format
   ```
   
   Please test it and give feedback.


-- 
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 closed issue #711: getPicture heic to jpeg support on Samsung Android phones

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


   


-- 
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] CGS38 commented on issue #711: getPicture heic to jpeg support on Samsung Android phones

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


   Unfortunately not... 


----------------------------------------------------------------
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] CodeWithOz commented on issue #711: getPicture heic to jpeg support on Samsung Android phones

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


   @CGS38 do you currently have any workarounds for 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] PieterVanPoyer commented on issue #711: getPicture heic to jpeg support on Samsung Android phones

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


   Hey @SnpDeveloper 
   
   So, the heic works just fine with the PR.
   
   About your observations and thoughts. I agree with it mostly. But for this issue, I'd just like to fix and focus on the heic case. Fix and focus on the original issue.
   
   For the other types, the behaviour is the same as before. (The original image and type is returned for Android) So it's a small improvement now.
   
   If we decide to convert the other types to the encodingType too, it's more a breaking change. And I am not willing to take that risk now, it needs a little more discussion with other people I think. _I suggest you make another issue for that._ And I agree/assume that should be the purpose of the encodingType.
   
   Hey @CGS38 
   Are you able to test this PR? And leave your testing results?
   
   ```
   npx cordova plugin remove cordova-plugin-camera
   npx cordova plugin add https://github.com/PieterVanPoyer/cordova-plugin-camera/#feature/issue-711-heif-format
   ```
   
   Kind regards
   Pieter


-- 
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] SnpDeveloper edited a comment on issue #711: getPicture heic to jpeg support on Samsung Android phones

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


   Thanks @PieterVanPoyer I have tested heic conversion, all seems to work fine. 
   
   But here are some of my observations, feel free to comment my thoughts
   
   1. bitmap conversion does a very excellent job. 
   	It converts GIF, BMP, JPG, PNG, HEIC to desired format (JPG in mycase)
   	
   2. While failing to convert (TIF, HEIF formats) I am getting a clear exception - App is not crashing (again as i would except and a good thing) so easy for me to show File format not support error message in my app.
   
   New changes you have made make sense preseving the encoding mimeType (JPG) extension.. a nice touch.
   
   What i dont understand is why we are restricting support only to JPG, PNG and HEIC, as mentioned before GIF, BMP, JPG, PNG, HEIC formats are all working.
   
   Some of my app using customer's upload BMP and GIF as well... 
   
   Correct me if I have missed anything.
   


-- 
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 edited a comment on issue #711: getPicture heic to jpeg support on Samsung Android phones

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


   You could try my branche for testing purposes.
   
   ```
   npx cordova plugin remove cordova-plugin-camera
   npx cordova plugin add https://github.com/PieterVanPoyer/cordova-plugin-camera/#feature/issue-711-heif-format
   ```
   
   Please test it and give feedback.


-- 
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 #711: getPicture heic to jpeg support on Samsung Android phones

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


   @SnpDeveloper with the change of code in the CameraLauncher, the plugin will convert the Heic photo to a JPEG?
   What happens when the Heic photo is not converted? Does the app crash, or it the photo just not shown?


-- 
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] SnpDeveloper commented on issue #711: getPicture heic to jpeg support on Samsung Android phones

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


   I am also looking for a workarround... any suggestions??


-- 
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] SnpDeveloper edited a comment on issue #711: getPicture heic to jpeg support on Samsung Android phones

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


   Thanks @PieterVanPoyer I have tested heic conversion, all seems to work fine. 
   
   But here are some of my observations, feel free to comment my thoughts
   
   1. bitmap conversion does a very excellent job. 
   	It converts GIF, BMP, JPG, PNG, HEIC to desired format (JPG in mycase)
   	
   2. While failing to convert on bitmap (TIF, HEIF formats) I am getting a clear exception - App is not crashing (again as i would except and a good thing) so easy for me to show File format not support error message in my app.
   
   New changes you have made make sense preseving the encoding mimeType (JPG) extension.. a nice touch.
   
   What i dont understand is why we are restricting support only to JPG, PNG and HEIC, as mentioned before GIF, BMP, JPG, PNG, HEIC formats are all working.
   
   Some of my app using customer's upload BMP and GIF as well... 
   
   Correct me if I have missed anything.
   


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