6.0.0-beta1
▾
Tasks
New Task
Search
Photos
Wiki
▾
Tickets
New Ticket
Search
dev.horde.org
Toggle Alerts Log
Help
9/2/25
H
istory
A
ttachments
C
omment
W
atch
Download
Comment on [#10420] Face similarity indexing is incorrect/broken
*
Your Email Address
*
Spam protection
Enter the letters below:
__ .___.__ . ..__. / `[__ | \| |[__] \__.[___|__/|/\|| |
Comment
> I've seen you have started to implement the correct face indexing in > git. Great! Just a hint: when you create the face indexes you will > miss out the last one (str_len - word_len == 0). > > Furthermore, there ist a call to a function "updatec" that does not exist. > And in getSignatureMatches() the f.image_id has to be part of the "GROUP BY". > > Here is my diff for these issues: > --- a/ansel/lib/Faces/Base.php > +++ b/ansel/lib/Faces/Base.php > @@ -555,7 +555,7 @@ class Ansel_Faces_Base > try { > $GLOBALS['ansel_db']->update('UPDATE ansel_images SET > image_faces = ' > . count($fids) . ' WHERE image_id = ' . $image->id); > - $GLOBALS['ansel_db']->updatec('UPDATE ansel_shares ' > + $GLOBALS['ansel_db']->update('UPDATE ansel_shares ' > . 'SET attribute_faces = attribute_faces + ' . count($fids) > . ' WHERE share_id = ' . $image->gallery); > } catch (Horde_Db_Exception $e) { > @@ -654,7 +654,7 @@ class Ansel_Faces_Base > $str_len = strlen($signature); > $GLOBALS['ansel_db']->delete('DELETE FROM ansel_faces_index > WHERE face_id = ' . $face_id); > $q = 'INSERT INTO ansel_faces_index (face_id, > index_position, index_part) VALUES (?, ?, ?)'; > - for ($i = 0; $i < $str_len - $word_len; $i++) { > + for ($i = 0; $i <= $str_len - $word_len; $i++) { > $data = array( > $face_id, > $i, > @@ -807,7 +807,7 @@ class Ansel_Faces_Base > $word_len = $GLOBALS['conf']['faces']['search']; > $str_len = strlen($signature); > $indexes = array(); > - for ($i = 0; $i < $str_len - $word_len; $i++) { > + for ($i = 0; $i <= $str_len - $word_len; $i++) { > $sig = new Horde_Db_Value_Binary(substr($signature, $i, > $word_len)); > $indexes[] = '(index_position = ' . $i . ' AND > index_part = ' . $sig->quote($GLOBALS['ansel_db']) . ')'; > } > @@ -822,7 +822,7 @@ class Ansel_Faces_Base > if ($indexes) { > $sql .= ' AND (' . implode(' OR ', $indexes) . ')'; > } > - $sql .= ' GROUP BY i.face_id, f.face_name HAVING > count(i.face_id) > 0 ' > + $sql .= ' GROUP BY i.face_id, f.face_name, f.image_id HAVING > count(i.face_id) > 0 ' > . 'ORDER BY count(i.face_id) DESC'; > $sql = $GLOBALS['ansel_db']->addLimitOffset( > $sql, >
Attachment
Watch this ticket
N
ew Ticket
M
y Tickets
S
earch
Q
uery Builder
R
eports
Saved Queries
Open Bugs
Bugs waiting for Feedback
Open Bugs in Releases
Open Enhancements
Enhancements waiting for Feedback
Bugs with Patches
Enhancements with Patches
Release Showstoppers
Stalled Tickets
New Tickets
Horde 5 Showstoppers