Skip to content

Commit

Permalink
handle null scheme in URI
Browse files Browse the repository at this point in the history
  • Loading branch information
n8fr8 committed Aug 1, 2017
1 parent df7c0bd commit fd9dff1
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions app/src/main/java/org/witness/securesmartcam/ImageEditor.java
Original file line number Diff line number Diff line change
Expand Up @@ -660,16 +660,13 @@ public void onClick(DialogInterface dialog, int whichButton) {
private void deleteOriginal() throws IOException {

if (originalImageUri != null) {
if (originalImageUri.getScheme().equals("file")) {
String origFilePath = originalImageUri.getPath();
File fileOrig = new File(origFilePath);

String origFilePath = originalImageUri.getPath();
File fileOrig = new File(origFilePath);

if (fileOrig.exists()) {

String[] columnsToSelect = {MediaStore.Images.Media._ID, MediaStore.Images.Media.DATA};

/*
ExifInterface ei = new ExifInterface(origFilePath);
long dateTaken = new Date(ei.getAttribute(ExifInterface.TAG_DATETIME)).getTime();
*/

Uri[] uriBases = {MediaStore.Images.Media.EXTERNAL_CONTENT_URI, MediaStore.Images.Media.INTERNAL_CONTENT_URI};

Expand Down

0 comments on commit fd9dff1

Please sign in to comment.