The option encodingType: **Camera.EncodingType.PNG gives the right path to load 
load JPEG** and **encodingType: Camera.EncodingType.JPEG gives the right path 
to load PNG**!
-I think there are two bugs.
1)Loading from the photo gallery should be indipendent from the encodingType.
2)If the loading from photo gallery is dependent from encodingType I think that 
encodingType: Camera.EncodingType.PNG shold give the right path to load PNG and 
encodingType: Camera.EncodingType.JPEG should  give the right path to load JPG

Here a code snippet to explain better what happens:
**Case a) encodingType: Camera.EncodingType.PNG**
In navigator.camera.getPicture([…]) if I use the following options:
destinationType: Camera.DestinationType.FILE_URI,
sourceType: Camera.PictureSourceType.SAVEDPHOTOALBUM,
allowEdit: false,
mediaType: Camera.MediaType.PICTURE,
**encodingType: Camera.EncodingType.PNG**
-I obtain **for a selected JPG picture the RIGHT path to load the JPG** that is 
in this case: 
file:///storage/sdcard0/Android/data/io.cordova.myapp1111/cache/IMG_20180901_150007.jpg?1535810391836
-I obtain **for a selected PNG picture the WRONG path to load the PNG** that is 
in this case:
content://com.android.providers.media.documents/document/image%3A2989

**Case b) encodingType: Camera.EncodingType.JPEG**
In navigator.camera.getPicture([…]) if I use the following options:
destinationType: Camera.DestinationType.FILE_URI,
sourceType: Camera.PictureSourceType.SAVEDPHOTOALBUM,
allowEdit: false,
mediaType: Camera.MediaType.PICTURE,
**encodingType: Camera.EncodingType.JPEG**
-I obtain **for a selected JPG picture the WRONG path to load the JPG** that is 
in this case: 
content://com.android.providers.media.documents/document/image%3A2992
-I obtain **for a selected PNG picture the RIGHT path to load the PNG** that is 
in this case:
file:///storage/sdcard0/Android/data/io.cordova.myapp1111/cache/IMG_20180901_145109.png?1535810818495

[ Full content available at: 
https://github.com/apache/cordova-plugin-camera/issues/334 ]
This message was relayed via gitbox.apache.org for [email protected]

Reply via email to