Hello,
I reported a bug (https://bugzilla.gnome.org/show_bug.cgi?id=775196)
concerning duplicate detection of RAW files during import. I found it in
version 0.22.0, but I think It also affects previous versions as well as
the latest from git (judging from the source code). I don't know if this
list gets automatically notified about new bug reports, so here it is (if
someone could review the bug & the proposed patch):
Current duplicate detection for RAW files works by comparing the filename
and file size. Unfortunately when importing RAW files from an sdcard I
noticed that Shotwell wrongly assumed that many files were duplicated and
already stored in the library. Upon further examination I discovered that
the criteria used for duplicate detection with RAW files are based only on
the basename and file size.
Now I have and use three cameras that are exactly the same make and model
(Sony A55), and I frequently have pictures generated on these different
cameras at different times that share the same filename (something like
DSC0XXXXX.ARW) and the SAME SIZE.
This means that Shotwell will import the first copy without issues but will
then detect files from other cameras as duplicates when there's a match
(name + filesize).
Now if the option to hide already imported files is set, Shotwell won't
show me some of the images and will not import them. When I import hundreds
of photos at once the fact that some of the photos are missing will get
easily unnoticed (I typically don't check every single file, I just select
to import all images). Unfortunately this way I might lose some pictures,
thinking that all photos have been safely copied on my computer: in
particular, if I format my sdcard all photos that were mistakenly
considered as duplicates by Shotwell will be unrecoverably lost.
Note: I marked this bug as major because it can cause data losses to an
end-user (as I've already experienced myself)
In attachment you will find a patch that should fixe this bug by comparing
not only the filename and filesize but also the exposure timestamp.
thank you
Amos
--- shotwell-0.22.0+git20160108.r1.f2fb1f7/src/camera/ImportPage.vala 2016-01-03 22:11:16.000000000 +0100
+++ shotwell-0.22.0+git20160108.r1.f2fb1f7-fix/src/camera/ImportPage.vala 2016-11-27 23:03:07.965097143 +0100
@@ -339,14 +339,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;
+ }
}
}
}
_______________________________________________
shotwell-list mailing list
[email protected]
https://mail.gnome.org/mailman/listinfo/shotwell-list