private void processCameraImage() {
   String path = filePathOriginal;
   ImageProcessorThread thread =
       new ImageProcessorThread(path, foldername, shouldCreateThumbnails);
   thread.setListener(this);
   thread.start();
 }
 @SuppressLint("NewApi")
 private void processImageFromGallery(Intent data) {
   if (data != null && data.getDataString() != null) {
     String uri = data.getData().toString();
     sanitizeURI(uri);
     if (filePathOriginal == null || TextUtils.isEmpty(filePathOriginal)) {
       onError("File path was null");
     } else {
       if (BuildConfig.DEBUG) {
         Log.i(TAG, "File: " + filePathOriginal);
       }
       String path = filePathOriginal;
       ImageProcessorThread thread =
           new ImageProcessorThread(path, foldername, shouldCreateThumbnails);
       thread.clearOldFiles(clearOldFiles);
       thread.setListener(this);
       thread.setContext(getContext());
       thread.start();
     }
   } else {
     onError("Image Uri was null!");
   }
 }