From 5f5a41805aa2af4667f546b31961a9dd60f12826 Mon Sep 17 00:00:00 2001 From: Damien De Paoli Date: Fri, 23 Dec 2022 13:38:13 +1100 Subject: [PATCH] remove use of tmp_locn, use explicit coords, sizes - partial BUG-108 fix --- files.py | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/files.py b/files.py index 4aa914b..d8d24b9 100644 --- a/files.py +++ b/files.py @@ -664,13 +664,11 @@ def viewlist(): # put locn data back into array format fid=0 for face in e.file_details.faces: - fix_face_locn(face) - tmp_locn = json.loads(face.locn) fd= {} - 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] + fd['x'] = face.face_left + fd['y'] = face.face_top + fd['w'] = face.w + fd['h'] = face.h if face.refimg: fd['who'] = face.refimg.person.tag fd['distance'] = round(face.refimg_lnk.face_distance,2) @@ -716,14 +714,6 @@ def view(id): continue # put locn data back into array format for face in e.file_details.faces: - if face.locn: - fix_face_locn(face) - face.tmp_locn = json.loads(face.locn) - else: - # this at least stops a 500 server error - seems to occur when - # DB contains disconnected faces with no locn data - BUG: 87 - face.tmp_locn = [ 0,0,0,0 ] - st.SetMessage( f"For some reason this face does not have a locn: face_id={face.id} tell ddp", "warning" ) # now get any relevant override and store it in objs... fnmo = FaceNoMatchOverride.query.filter(FaceNoMatchOverride.face_id==face.id).first() if fnmo: @@ -733,7 +723,6 @@ def view(id): mo.type = FaceOverrideType.query.filter( FaceOverrideType.name== 'Manual match to existing person' ).first() face.manual_override=mo - eids=eids.rstrip(",") # jic, sometimes we trip this, and rather than show broken pages / destroy # face locn data, just warn & redirect