-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
getPicture heic to jpeg support on Samsung Android phones #711
Comments
@CGS38 do you currently have any workarounds for this? |
Unfortunately not... |
I am also looking for a workarround... any suggestions?? |
Only way i was able to achieve / make heic file type to convert jpeg is modifying CameraLauncher.java Line 718: To There should be a better way... for me this helped.. |
@SnpDeveloper with the change of code in the CameraLauncher, the plugin will convert the Heic photo to a JPEG? |
In my local testing with Samsung device uploaded image size got compressed didnt give me any error or crash. |
You could try my branche for testing purposes.
Please test it and give feedback. |
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. |
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
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. |
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
Kind regards |
Issue Type
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
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
The text was updated successfully, but these errors were encountered: