mirror of
https://github.com/apache/cordova-android.git
synced 2025-02-20 23:56:20 +08:00
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/incubator-cordova-android into CordovaWebView
This commit is contained in:
commit
c8af154205
@ -156,9 +156,10 @@ public class Capture extends Plugin {
|
||||
* @throws JSONException
|
||||
*/
|
||||
private JSONObject getImageData(String filePath, JSONObject obj) throws JSONException {
|
||||
Bitmap bitmap = BitmapFactory.decodeFile(filePath);
|
||||
Bitmap bitmap = BitmapFactory.decodeFile(FileUtils.stripFileProtocol(filePath));
|
||||
obj.put("height", bitmap.getHeight());
|
||||
obj.put("width", bitmap.getWidth());
|
||||
bitmap.recycle();
|
||||
return obj;
|
||||
}
|
||||
|
||||
|
@ -743,7 +743,7 @@ public class FileUtils extends Plugin {
|
||||
* @param filePath to be checked.
|
||||
* @return
|
||||
*/
|
||||
private String stripFileProtocol(String filePath) {
|
||||
public static String stripFileProtocol(String filePath) {
|
||||
if (filePath.startsWith("file://")) {
|
||||
filePath = filePath.substring(7);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user