|
@@ -1767,7 +1767,12 @@ public class FileDataStorageManager {
|
|
|
values.put(MediaStore.Images.Media.DATE_ADDED, System.currentTimeMillis() / 1000);
|
|
|
values.put(MediaStore.Images.Media.RELATIVE_PATH, path);
|
|
|
values.put(MediaStore.Images.Media.IS_PENDING, 0);
|
|
|
- contentResolver.insert(MediaStore.Images.Media.getContentUri(MediaStore.VOLUME_EXTERNAL_PRIMARY), values);
|
|
|
+ try {
|
|
|
+ contentResolver.insert(MediaStore.Images.Media.getContentUri(MediaStore.VOLUME_EXTERNAL_PRIMARY),
|
|
|
+ values);
|
|
|
+ } catch (IllegalArgumentException e) {
|
|
|
+ Log_OC.e("MediaScanner", "Adding image to media scanner failed: " + e);
|
|
|
+ }
|
|
|
} else {
|
|
|
Intent intent = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE);
|
|
|
intent.setData(Uri.fromFile(new File(path)));
|