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

This commit is contained in:
2022-01-28 20:48:56 +11:00
parent 9a480dccd8
commit fee993711f
3 changed files with 10 additions and 9 deletions

4
BUGs
View File

@@ -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

View File

@@ -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)

View File

@@ -9,6 +9,7 @@
<div id="F{{f.id}}" class="col col-auto mt-3 pr-1">
<form id="_fm" method="POST" action="/view/{{f.file_eid}}">
<input type="hidden" name="eids" value="{{f.file_eid}},">
<input type="hidden" name="orig_url" value="/files_ip">
<figure id="fig_{{f.id}}" class="mb-0">
<div style="position:relative">
<canvas id="c_{{f.id}}" height="128"></canvas>
@@ -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}} ) });