private void tryCorrectPhotoFileCaptured(){
  if (mPhotoFileCapture == null || mFilesCreatedWhileCapturePhoto == null || mFilesCreatedWhileCapturePhoto.size() <= 0)   return;
  long captureSize=mPhotoFileCapture.length();
  for (  File file : mFilesCreatedWhileCapturePhoto) {
    if (MediaUtils.isImageExtension(MediaUtils.getFileExtension(file)) && file.length() >= captureSize && !file.equals(mPhotoFileCapture)) {
      boolean value=mPhotoFileCapture.delete();
      mPhotoFileCapture=file;
      Log.i(TAG,String.format("Try correct photo file: Delete duplicate photos in [%s] [%s]",mPhotoFileCapture,value));
      return;
    }
  }
}

private void tryCorrectPhotoFileCaptured ( ) { if ( mPhotoFileCapture == null || mFilesCreatedWhileCapturePhoto == null || mFilesCreatedWhileCapturePhoto . size ( ) <= 0 ) return ; long captureSize = mPhotoFileCapture . length ( ) ; for ( File file : mFilesCreatedWhileCapturePhoto ) { if ( MediaUtils . isImageExtension ( MediaUtils . getFileExtension ( file ) ) && file . length ( ) >= captureSize && ! file . equals ( mPhotoFileCapture ) ) { boolean value = mPhotoFileCapture . delete ( ) ; mPhotoFileCapture = file ; Log . i ( TAG , String . format ( "Try correct photo file: Delete duplicate photos in [%s] [%s]" , mPhotoFileCapture , value ) ) ; return ; } } }
in some htc devices ( maybe others ) , duplicate image when captured with extra_output . this method will try delete duplicate image . it ' s prefer default image by camera than extra output .
