fixed BUG-86 - last places changed from locn to tmp_locn

This commit is contained in:
2022-06-10 16:49:03 +10:00
parent 3d30d21763
commit 18ec0f87f5
3 changed files with 5 additions and 5 deletions

1
BUGs
View File

@@ -1,7 +1,6 @@
### Next: 88
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
BUG-85: once we rebuild data from scratch, need to reset just clean out pa_user_state's
BUG-86: had some face locn data be in { } not [ ] again -- I think we need to stop using locn in the DB and instead use a tmp_locn or something else -- no way to touch the DB data then
BUG-87: using Person->show matches->then view an image shows bug in viewer with msising data in json -- that same image via a filename search works...
-- seems some faces have an empty locn, but do have a w and h... (ORM - tmp_locn vs locn???)
# select id, locn, w, h from face where locn is null;

View File

@@ -666,6 +666,7 @@ def viewlist():
resp['objs'][e.id]['name'] = e.name
resp['objs'][e.id]['type'] = e.type.name
if e.file_details.faces:
# model is used for whole file, so set it at that level (based on first face)
resp['objs'][e.id]['face_model'] = e.file_details.faces[0].facefile_lnk.model_used
resp['objs'][e.id]['faces'] = []
@@ -724,11 +725,11 @@ def view(id):
# put locn data back into array format
for face in e.file_details.faces:
if face.locn:
face.locn = json.loads(face.locn)
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.locn = [ 0,0,0,0 ]
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" )

View File

@@ -41,8 +41,8 @@
{% for face in objs[id].file_details.faces %}
data = {
'id': '{{face.id}}',
'x': '{{face.locn[3]}}', 'y': '{{face.locn[0]}}',
'w': '{{face.locn[1]-face.locn[3]}}', 'h':'{{face.locn[2]-face.locn[0]}}'
'x': '{{face.tmp_locn[3]}}', 'y': '{{face.tmp_locn[0]}}',
'w': '{{face.tmp_locn[1]-face.tmp_locn[3]}}', 'h':'{{face.tmp_locn[2]-face.tmp_locn[0]}}'
}
{% if face.refimg %}
data['who']='{{face.refimg.person.tag}}'