Face browsing works
Signed-off-by: James Ketrenos <james_gitlab@ketrenos.com>
This commit is contained in:
parent
b5e1fee344
commit
594670fdad
@ -18,12 +18,13 @@ body {
|
|||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
z-index: 100;
|
z-index: 100;
|
||||||
background: rgba(0, 0, 0, 0.5);
|
background: rgba(0, 0, 0, 0.5);
|
||||||
|
padding: 0.5em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.view {
|
.view {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
width: 200px;
|
width: 100px;
|
||||||
height: 200px;
|
height: 100px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
margin: 0 1em;
|
margin: 0 1em;
|
||||||
@ -31,6 +32,9 @@ body {
|
|||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
vertical-align: bottom;
|
vertical-align: bottom;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
background-position: 50% 50%;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-size: contain;
|
||||||
}
|
}
|
||||||
|
|
||||||
.face {
|
.face {
|
||||||
@ -198,6 +202,10 @@ function loadPhoto(index) {
|
|||||||
|
|
||||||
document.getElementById("loading").textContent = "0%";
|
document.getElementById("loading").textContent = "0%";
|
||||||
|
|
||||||
|
const bar = document.getElementById("bar");
|
||||||
|
if (bar) {
|
||||||
|
bar.parentElement.removeChild(bar);
|
||||||
|
}
|
||||||
xml.onprogress = function (event) {
|
xml.onprogress = function (event) {
|
||||||
var alpha = 0;
|
var alpha = 0;
|
||||||
if (event.total) {
|
if (event.total) {
|
||||||
|
@ -801,10 +801,6 @@ function getFacesForPhoto(id) {
|
|||||||
type: photoDB.Sequelize.QueryTypes.SELECT,
|
type: photoDB.Sequelize.QueryTypes.SELECT,
|
||||||
raw: true
|
raw: true
|
||||||
}).then((faceIds) => {
|
}).then((faceIds) => {
|
||||||
let ids = faceIds.map((face) => {
|
|
||||||
return (face.face1Id == face.id) ? face.face2Id : face.face1Id;
|
|
||||||
});
|
|
||||||
|
|
||||||
return photoDB.sequelize.query(
|
return photoDB.sequelize.query(
|
||||||
"SELECT photos.id,faces.id AS faceId,fd.distance,albums.path,photos.filename " +
|
"SELECT photos.id,faces.id AS faceId,fd.distance,albums.path,photos.filename " +
|
||||||
"FROM faces " +
|
"FROM faces " +
|
||||||
@ -817,7 +813,9 @@ function getFacesForPhoto(id) {
|
|||||||
") " +
|
") " +
|
||||||
"WHERE faces.id IN (:ids)", {
|
"WHERE faces.id IN (:ids)", {
|
||||||
replacements: {
|
replacements: {
|
||||||
ids: ids,
|
ids: faceIds.map((match) => {
|
||||||
|
return (match.face1Id == face.id) ? match.face2Id : match.face1Id;
|
||||||
|
}),
|
||||||
faceId: face.id
|
faceId: face.id
|
||||||
},
|
},
|
||||||
type: photoDB.Sequelize.QueryTypes.SELECT,
|
type: photoDB.Sequelize.QueryTypes.SELECT,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user