Removed need for getFormatData/Image to load image into memory

This commit is contained in:
macdonst 2012-06-13 15:57:17 -04:00
parent 56047e5fc8
commit 34820f4344

View File

@ -156,10 +156,11 @@ public class Capture extends Plugin {
* @throws JSONException
*/
private JSONObject getImageData(String filePath, JSONObject obj) throws JSONException {
Bitmap bitmap = BitmapFactory.decodeFile(FileUtils.stripFileProtocol(filePath));
obj.put("height", bitmap.getHeight());
obj.put("width", bitmap.getWidth());
bitmap.recycle();
BitmapFactory.Options options = new BitmapFactory.Options();
options.inJustDecodeBounds = true;
BitmapFactory.decodeFile(FileUtils.stripFileProtocol(filePath), options);
obj.put("height", options.outHeight);
obj.put("width", options.outWidth);
return obj;
}