Compare commits

...

2 Commits

Author SHA1 Message Date
6c9cb4201a 0.51.6 2026-07-05 04:33:14 +02:00
7c32a5e824 Improved tag actor avatar size calculation. 2026-07-05 04:33:12 +02:00
3 changed files with 9 additions and 15 deletions

4
package-lock.json generated
View File

@@ -1,11 +1,11 @@
{ {
"name": "traxxx-web", "name": "traxxx-web",
"version": "0.51.5", "version": "0.51.6",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"version": "0.51.5", "version": "0.51.6",
"dependencies": { "dependencies": {
"@brillout/json-serializer": "^0.5.8", "@brillout/json-serializer": "^0.5.8",
"@dicebear/collection": "^7.0.5", "@dicebear/collection": "^7.0.5",

View File

@@ -92,7 +92,7 @@
"overrides": { "overrides": {
"vite": "$vite" "vite": "$vite"
}, },
"version": "0.51.5", "version": "0.51.6",
"imports": { "imports": {
"#/*": "./*.js" "#/*": "./*.js"
} }

View File

@@ -505,21 +505,15 @@ function getFaceCrop(biometrics) {
} }
if (leftEye && rightEye && mouth) { if (leftEye && rightEye && mouth) {
const xs = [leftEye[0], rightEye[0], mouth[0]]; const avgEyeY = (leftEye[1] + rightEye[1]) / 2;
const ys = [leftEye[1], rightEye[1], mouth[1]]; const avgEyeX = (leftEye[0] + rightEye[0]) / 2;
const minX = Math.min(...xs); const eyesToMouth = mouth[1] - avgEyeY;
const maxX = Math.max(...xs);
const minY = Math.min(...ys);
const maxY = Math.max(...ys);
const triangleWidth = maxX - minX; const centerX = (avgEyeX + mouth[0]) / 2;
const triangleHeight = maxY - minY; const centerY = (avgEyeY + mouth[1]) / 2;
const centerX = (minX + maxX) / 2; const size = eyesToMouth * avatarMargin;
const centerY = (minY + maxY) / 2;
const size = Math.max(triangleWidth, triangleHeight) * avatarMargin;
return clampCrop({ return clampCrop({
left: centerX - size / 2, left: centerX - size / 2,