public static void writeBitmapToFile(Bitmap bm, File file, int quality) throws IOException {

        FileOutputStream fos = new FileOutputStream(file);
        bm.compress(Bitmap.CompressFormat.JPEG, quality, fos);
        fos.flush();
        fos.close();
    }
Write the given bitmap into the given file. JPEG is used as the compression format with
quality set
to 100.

@param bm   The bitmap.
@param file The file to write the bitmap into.
sample/src/main/java/com/fenctose/imagecropper/BitmapUtils.java