I'm trying to retrieve a PNG picture using cordova-plugin-camera, with that code :
navigator.camera.getPicture(onPictSuccess, onFailPict, { quality: 50, encodingType:Camera.EncodingType.PNG, destinationType:navigator.camera.DestinationType.FILE_URI});
But it's always return a JPG file. Did someone succeed getting PNG on Android ?
Looking at tha java plugin source for Android in CameraLauncher.java l.390 and in many other locations ".jpg" seems to be hardcoded :
uri = Uri.fromFile(new File(getTempDirectoryPath(), System.currentTimeMillis() + ".jpg"));
I tried replacing ".jpg" with ".png" but of course that only change the name of the extension.
Well, I was not so far from the solution. A few lines below in processResultFromCamera() (l.413) a jpeg reference is also hardcoded
that I replaced by :
So the plugin's doc is wrong PNG isn't supported for Android. And I don't know more about github to correct the code