mirror of
https://github.com/apache/cordova-android.git
synced 2025-01-31 17:32:51 +08:00
Removed need for getFormatData/Image to load image into memory
This commit is contained in:
parent
56047e5fc8
commit
34820f4344
@ -156,10 +156,11 @@ public class Capture extends Plugin {
|
|||||||
* @throws JSONException
|
* @throws JSONException
|
||||||
*/
|
*/
|
||||||
private JSONObject getImageData(String filePath, JSONObject obj) throws JSONException {
|
private JSONObject getImageData(String filePath, JSONObject obj) throws JSONException {
|
||||||
Bitmap bitmap = BitmapFactory.decodeFile(FileUtils.stripFileProtocol(filePath));
|
BitmapFactory.Options options = new BitmapFactory.Options();
|
||||||
obj.put("height", bitmap.getHeight());
|
options.inJustDecodeBounds = true;
|
||||||
obj.put("width", bitmap.getWidth());
|
BitmapFactory.decodeFile(FileUtils.stripFileProtocol(filePath), options);
|
||||||
bitmap.recycle();
|
obj.put("height", options.outHeight);
|
||||||
|
obj.put("width", options.outWidth);
|
||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user