mirror of
https://github.com/apache/cordova-android.git
synced 2026-04-23 00:00:09 +08:00
Handle content:// uri's in resolveLocalFileSystemURI
Sometimes Android will hand you a content:// uri in the place of a file path. Particularily the Camera.getPicture() code will do this. I've updated the file utils code to handle this type of uri and return a real file path.
This commit is contained in:
@@ -95,7 +95,13 @@ public class Capture extends Plugin {
|
||||
obj.put("duration", 0);
|
||||
obj.put("codecs", "");
|
||||
|
||||
if (mimeType.equals("image/jpeg")) {
|
||||
// If the mimeType isn't set the rest will fail
|
||||
// so let's see if we can determine it.
|
||||
if (mimeType == null || mimeType.equals("")) {
|
||||
mimeType = FileUtils.getMimeType(filePath);
|
||||
}
|
||||
|
||||
if (mimeType.equals("image/jpeg") || filePath.endsWith(".jpg")) {
|
||||
obj = getImageData(filePath, obj);
|
||||
}
|
||||
else if (filePath.endsWith("audio/3gpp")) {
|
||||
|
||||
Reference in New Issue
Block a user