This commit is contained in:
Joe Bowser 2012-06-05 10:05:36 -07:00
commit c8af154205
2 changed files with 3 additions and 2 deletions

View File

@ -156,9 +156,10 @@ 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(filePath); Bitmap bitmap = BitmapFactory.decodeFile(FileUtils.stripFileProtocol(filePath));
obj.put("height", bitmap.getHeight()); obj.put("height", bitmap.getHeight());
obj.put("width", bitmap.getWidth()); obj.put("width", bitmap.getWidth());
bitmap.recycle();
return obj; return obj;
} }

View File

@ -743,7 +743,7 @@ public class FileUtils extends Plugin {
* @param filePath to be checked. * @param filePath to be checked.
* @return * @return
*/ */
private String stripFileProtocol(String filePath) { public static String stripFileProtocol(String filePath) {
if (filePath.startsWith("file://")) { if (filePath.startsWith("file://")) {
filePath = filePath.substring(7); filePath = filePath.substring(7);
} }