framework/src/org/apache/cordova/CameraLauncher.java
/**
     * Used to find out if we are in a situation where the Camera Intent adds to images
     * to the content store. If we are using a FILE_URI and the number of images in the DB
     * increases by 2 we have a duplicate, when using a DATA_URL the number is 1.
     *
     * @param type FILE_URI or DATA_URL
     */
Used to find out if we are in a situation where the Camera Intent adds to images
to the content store. If we are using a FILE_URI and the number of images in the DB
increases by 2 we have a duplicate, when using a DATA_URL the number is 1.


Used to find out if we are in a situation where the Camera Intent adds to images to the content store . If we are using a FILE_URI and the number of images in the DB increases by 2 we have a duplicate when using a DATA_URL the number is 1 .
private void checkForDuplicateImage(int type) {
        int diff = 1;
        Uri contentStore = whichContentStore();
        Cursor cursor = queryImgDB(contentStore);
        int currentNumOfImages = cursor.getCount();
        if (type == FILE_URI) {
            diff = 2;
        }
        if ((currentNumOfImages - numPics) == diff) {
            cursor.moveToLast();
            int id = Integer.valueOf(cursor.getString(cursor.getColumnIndex(MediaStore.Images.Media._ID))) - 1;
            Uri uri = Uri.parse(contentStore + "/" + id);
            this.cordova.getActivity().getContentResolver().delete(uri, null, null);
        }
    }
private void checkForDuplicateImage ( int type ) { int diff = 1 ; Uri contentStore = whichContentStore ( ) ; Cursor cursor = queryImgDB ( contentStore ) ; int currentNumOfImages = cursor . getCount ( ) ; if ( type == FILE_URI ) { diff = 2 ; } if ( ( currentNumOfImages - numPics ) == diff ) { cursor . moveToLast ( ) ; int id = Integer . valueOf ( cursor . getString ( cursor . getColumnIndex ( MediaStore . Images . Media . _ID ) ) ) - 1 ; Uri uri = Uri . parse ( contentStore + "/" + id ) ; this . cordova . getActivity ( ) . getContentResolver ( ) . delete ( uri , null , null ) ; } }
Used to find out if we are in a situation where the Camera Intent adds to images
 to the content store.
Used to find out if we are in a situation where the Camera Intent adds to images to the content store .
// delete the duplicate file if the difference is 2 for file URI or 1 for Data URL