code: public static Observable<Bitmap> getThumbnail(String filePath) {
      return getFileType(filePath).filter(new Func1<String, Boolean>() {
        @Override
        public Boolean call(String s) {
          return s != null;
        }
      }).flatMap(new Func1<String, Observable<Bitmap>>() {
        @Override
        public Observable<Bitmap> call(String s) {
          if (s.equalsIgnoreCase(Constants.VIDEO)) {
            return getVideoThumbnail(s);
          } else if (s.equalsIgnoreCase(Constants.IMAGE)) return getThumbnailFromPath(s);
          return null;
        }
      });
    }
docs: /*
  Get thumbnail from a File path.