From fee993711fc2894db9c9dfbd5bf7987f08199d05 Mon Sep 17 00:00:00 2001 From: Damien De Paoli Date: Fri, 28 Jan 2022 20:48:56 +1100 Subject: [PATCH] hacked /files_ip for now, this whole page is a bit of a mess, not sure we keep it - and its a kludge to assume its in the file_ip path -- only will work if img is in import path and we are viewing in flat mode, but at least this means we dont break the app, just get a confused viewer message. Also use tmp_locn rather than face.locn for viewlist to fix BUG-82 --- BUGs | 4 +--- files.py | 12 +++++++----- templates/faces.html | 3 ++- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/BUGs b/BUGs index 947e58e..f72209c 100644 --- a/BUGs +++ b/BUGs @@ -1,4 +1,2 @@ ### Next: 83 -BUG-60: entries per page in flat view will get how_many from each top-level dir in PATH (not a big issue, but it is a little misleading) -BUG-82: occasionally, the face_locn data in the DB is {} not [], and if faces in data viewer crashes -- 'next' too fast and offset gets larger than the end of the eids list - - can't next to end for flat view of PATH with multiple Dirs (but-60) above... (list of ents, if > how_many, just should not include next dir content) +BUG-60: entries per page in flat view will get how_many from each top-level dir in PATH - causes viewer to get lost in eids for last_eid diff --git a/files.py b/files.py index 8b962be..3f7e63a 100644 --- a/files.py +++ b/files.py @@ -642,6 +642,8 @@ def viewlist(): # this occurs when we went from the last image on a page (with how_many on # it) and it just happened to also be the last in the DB... if not entries: + print("DDP: DONT think this can happen anymore") + # undo the skip by how_many and getentries again OPT.offset -= int(OPT.how_many) entries=GetEntries( OPT ) @@ -665,12 +667,12 @@ def viewlist(): # put locn data back into array format fid=0 for face in e.file_details.faces: - face.locn = json.loads(face.locn) + tmp_locn = json.loads(face.locn) fd= {} - fd['x'] = face.locn[3] - fd['y'] = face.locn[0] - fd['w'] = face.locn[1]-face.locn[3] - fd['h'] = face.locn[2]-face.locn[0] + fd['x'] = tmp_locn[3] + fd['y'] = tmp_locn[0] + fd['w'] = tmp_locn[1]-tmp_locn[3] + fd['h'] = tmp_locn[2]-tmp_locn[0] if face.refimg: fd['who'] = face.refimg.person.tag fd['distance'] = round(face.refimg_lnk.face_distance,2) diff --git a/templates/faces.html b/templates/faces.html index aede83e..3f97cca 100644 --- a/templates/faces.html +++ b/templates/faces.html @@ -9,6 +9,7 @@
+
@@ -25,7 +26,7 @@ orig_face_{{f.id}}.orig_w = {{f.locn[1]}}*1.05 - {{f.locn[3]}}*.95 orig_face_{{f.id}}.orig_h = {{f.locn[2]}}*1.05 - {{f.locn[0]}}*.95 - console.log( orig_face_{{f.id}} ) + //console.log( orig_face_{{f.id}} ) // when the document is ready, then DrawRefimg $(function() { DrawUnmatchedFace( fig_{{f.id}}, im_{{f.id}}, c_{{f.id}}, orig_face_{{f.id}} ) });