[shotwell/shotwell-0.24] Improved Raw duplicate detection
- From: Jens Georg <jensgeorg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [shotwell/shotwell-0.24] Improved Raw duplicate detection
- Date: Sat, 14 Jan 2017 12:24:28 +0000 (UTC)
commit 5c4452bbe1cd98b281d232ea07b8e6d85054f8b4
Author: Amos Brocco <amos brocco gmail com>
Date: Sun Nov 27 22:17:00 2016 +0000
Improved Raw duplicate detection
Use exposure timestamp comparison as well as file name to distinguish between
different files with the same name
https://bugzilla.gnome.org/show_bug.cgi?id=775196
src/camera/ImportPage.vala | 22 +++++++++++++++-------
1 files changed, 15 insertions(+), 7 deletions(-)
---
diff --git a/src/camera/ImportPage.vala b/src/camera/ImportPage.vala
index 45924f9..7dbfebe 100644
--- a/src/camera/ImportPage.vala
+++ b/src/camera/ImportPage.vala
@@ -338,14 +338,22 @@ class ImportPreview : MediaSourceItem {
uint64 filesize = get_import_source().get_filesize();
// unlikely to be a problem, but what the hay
if (filesize <= int64.MAX) {
- if (LibraryPhoto.global.has_basename_filesize_duplicate(
- get_import_source().get_filename(), (int64) filesize)) {
+ PhotoID duplicated_photo_id = LibraryPhoto.global.get_basename_filesize_duplicate(
+ get_import_source().get_filename(), (int64) filesize);
+
+ if (duplicated_photo_id.is_valid()) {
+ // Check exposure timestamp
+ LibraryPhoto duplicated_photo = LibraryPhoto.global.fetch(duplicated_photo_id);
+ time_t photo_exposure_time = photo_import_source.get_exposure_time();
+ time_t duplicated_photo_exposure_time = duplicated_photo.get_exposure_time();
- duplicated_file = DuplicatedFile.create_from_photo_id(
- LibraryPhoto.global.get_basename_filesize_duplicate(
- get_import_source().get_filename(), (int64) filesize));
-
- return true;
+ if (photo_exposure_time == duplicated_photo_exposure_time) {
+ duplicated_file = DuplicatedFile.create_from_photo_id(
+ LibraryPhoto.global.get_basename_filesize_duplicate(
+ get_import_source().get_filename(), (int64) filesize));
+
+ return true;
+ }
}
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]