Inline
This commit is contained in:
parent
5aee42d59d
commit
825f5ff88d
|
@ -735,20 +735,16 @@ const extractFaceCrop = (
|
||||||
height: alignment.size,
|
height: alignment.size,
|
||||||
});
|
});
|
||||||
|
|
||||||
const padding = 0.25;
|
const paddedBox = roundBox(enlargeBox(alignmentBox, 1.5));
|
||||||
const scaleForPadding = 1 + padding * 2;
|
|
||||||
const paddedBox = roundBox(enlargeBox(alignmentBox, scaleForPadding));
|
|
||||||
|
|
||||||
return cropImage(imageBitmap, paddedBox, 256);
|
return cropImage(imageBitmap, paddedBox, 256);
|
||||||
};
|
};
|
||||||
|
|
||||||
const cropImage = (
|
const cropImage = (
|
||||||
imageBitmap: ImageBitmap,
|
imageBitmap: ImageBitmap,
|
||||||
cropBox: Box,
|
box: Box,
|
||||||
maxDimension: number,
|
maxDimension: number,
|
||||||
) => {
|
) => {
|
||||||
const box = roundBox(cropBox);
|
|
||||||
|
|
||||||
const outputSize = { width: box.width, height: box.height };
|
const outputSize = { width: box.width, height: box.height };
|
||||||
|
|
||||||
const scale = Math.min(maxDimension / box.width, maxDimension / box.height);
|
const scale = Math.min(maxDimension / box.width, maxDimension / box.height);
|
||||||
|
|
Loading…
Reference in a new issue