fix(server): more robust person thumbnail generation (#17974)

* more robust person thumbnail generation

* clamp bounding boxes

* update sql

* no need to process invalid images after decoding

* cursed knowledge

* new line
This commit is contained in:
Mert 2025-05-06 14:18:22 -04:00 committed by GitHub
parent d33ce13561
commit 2a80251dc3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 491 additions and 223 deletions

View file

@ -301,3 +301,7 @@ export const globToSqlPattern = (glob: string) => {
const tokens = picomatch.parse(glob).tokens;
return tokens.map((token) => convertTokenToSqlPattern(token)).join('');
};
export function clamp(value: number, min: number, max: number) {
return Math.max(min, Math.min(max, value));
}