@Override
  protected Result doInBackground(Void... params) {
    try {
      if (!isCancelled()) {

        BitmapUtils.BitmapSampled decodeResult =
            BitmapUtils.decodeSampledBitmap(mContext, mUri, mWidth, mHeight);

        if (!isCancelled()) {

          BitmapUtils.RotateBitmapResult rotateResult =
              BitmapUtils.rotateBitmapByExif(decodeResult.bitmap, mContext, mUri);

          return new Result(
              mUri, rotateResult.bitmap, decodeResult.sampleSize, rotateResult.degrees);
        }
      }
      return null;
    } catch (Exception e) {
      return new Result(mUri, e);
    }
  }
Decode image in background.

@param params ignored
@return the decoded bitmap data
core/src/main/java/com/theartofdev/edmodo/cropper/BitmapLoadingWorkerTask.java