first pass of allowing to scan for all files in import and storage paths <- works, and showing all unknown faces to handle them somehow - very rudimentary

This commit is contained in:
2022-01-10 01:20:20 +11:00
parent 27dadacd5c
commit bf04c862d6
6 changed files with 146 additions and 35 deletions

View File

@@ -1,35 +1,5 @@
{% extends "base.html" %} {% block main_content %}
<script>
// Define this once and before it will be called, hence at the top of this file
function DrawRefimg(fig, img, canvas, orig_face )
{
// FIXME: should get this from shared.py, not sure why this doesnt work at present
thumbsize=256
context=canvas.getContext('2d')
// another call to this func will occur on load, so skip this one
if( img.width == 0 )
return
// only set canvas.width once we have valid img dimensions
canvas.width=img.width/2
// actually draw the pixel images to the canvas at the right size
context.drawImage(img, 0, 0, img.width/(img.height/canvas.height), canvas.height);
fig.width(canvas.width)
// draw rectangle on face
context.beginPath();
new_x=(orig_face.x/orig_face.orig_w)*img.width/(img.height/canvas.height)
new_y=(orig_face.y/orig_face.orig_h)*thumbsize/(img.height/canvas.height)
new_w=(orig_face.w/orig_face.orig_w)*img.width/(img.height/canvas.height)
new_h=(orig_face.h/orig_face.orig_h)*thumbsize/(img.height/canvas.height)
context.rect(new_x, new_y, new_w, new_h)
context.lineWidth = 2;
context.strokeStyle = 'green';
context.stroke();
}
</script>
<script src="{{ url_for( 'internal', filename='js/face.js')}}"></script>
<div class="container-fluid">
<div class="row col-12"><h3 class="offset-3">{{page_title}}</h3></div>