summaryrefslogtreecommitdiff
path: root/src/Photo.vala
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2018-10-01 07:17:16 +0200
committerJörg Frings-Fürst <debian@jff.email>2018-10-01 07:17:16 +0200
commit71137cc5832110d91599d68790402cf196762ed3 (patch)
treee7985bbfb6ca50ea738b38a9f852ee51431d48a7 /src/Photo.vala
parent8ae550d463720d5d1c0e253af29843ff15de1a54 (diff)
parent1e92964463e564bb3359a7110342182fcfdc67f2 (diff)
Merge branch 'release/debian/0.30.1-1'debian/0.30.1-1
Diffstat (limited to 'src/Photo.vala')
-rw-r--r--src/Photo.vala22
1 files changed, 19 insertions, 3 deletions
diff --git a/src/Photo.vala b/src/Photo.vala
index f089d79..0d8e955 100644
--- a/src/Photo.vala
+++ b/src/Photo.vala
@@ -4698,7 +4698,7 @@ public class LibraryPhotoSourceCollection : MediaSourceCollection {
Gee.HashMultiMap<Tag, LibraryPhoto> map = new Gee.HashMultiMap<Tag, LibraryPhoto>();
foreach (MediaSource media in media_sources) {
LibraryPhoto photo = (LibraryPhoto) media;
- PhotoMetadata metadata = photo.get_metadata();
+ PhotoMetadata? metadata = photo.get_metadata();
// get an index of all the htags in the application
HierarchicalTagIndex global_index = HierarchicalTagIndex.get_global_index();
@@ -4709,7 +4709,7 @@ public class LibraryPhotoSourceCollection : MediaSourceCollection {
// hierarchical tag information as plain old tags. If a tag name appears as part of
// a hierarchical path, it needs to be excluded from being processed as a flat tag
HierarchicalTagIndex? htag_index = null;
- if (metadata.has_hierarchical_keywords()) {
+ if (metadata != null && metadata.has_hierarchical_keywords()) {
htag_index = HierarchicalTagUtilities.process_hierarchical_import_keywords(
metadata.get_hierarchical_keywords());
}
@@ -4732,7 +4732,7 @@ public class LibraryPhotoSourceCollection : MediaSourceCollection {
}
}
- if (metadata.has_hierarchical_keywords()) {
+ if (metadata != null && metadata.has_hierarchical_keywords()) {
foreach (string path in htag_index.get_all_paths()) {
string? name = Tag.prep_tag_name(path);
if (name != null)
@@ -5216,6 +5216,22 @@ public class LibraryPhoto : Photo, Flaggable, Monitorable {
}
}
+#if ENABLE_FACES
+ // Attach faces.
+ Gee.Collection<Face>? faces = Face.global.fetch_for_source(this);
+ if (faces != null) {
+ foreach (Face face in faces) {
+ FaceLocation? location = FaceLocation.get_face_location(face.get_face_id(),
+ this.get_photo_id());
+ if (location != null) {
+ face.attach(dupe);
+ FaceLocation.create(face.get_face_id(), dupe.get_photo_id(),
+ location.get_serialized_geometry());
+ }
+ }
+ }
+#endif
+
return dupe;
}