/** * Take jpeg bytes and add them to the media store, either replacing an existing item or a * placeholder uri to replace * * @param imageUri The content uri or session uri of the image being updated * @param resolver The content resolver to use * @param title of the image * @param date of the image * @param location of the image * @param orientation of the image * @param exif of the image * @param jpeg bytes of the image * @param width of the image * @param height of the image * @param mimeType of the image * @return The content uri of the newly inserted or replaced item. */ public static Uri updateImage( Uri imageUri, ContentResolver resolver, String title, long date, Location location, int orientation, ExifInterface exif, byte[] jpeg, int width, int height, String mimeType) throws IOException { String path = generateFilepath(title, mimeType); writeFile(path, jpeg, exif); return updateImage( imageUri, resolver, title, date, location, orientation, jpeg.length, path, width, height, mimeType); }