mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
fix: convert input buffer to PNG before passing to face landmarks Python sidecar
AVIF (and other Sharp-native formats) were written as raw bytes to a .png temp file, causing PIL to fail with "cannot identify image file". Every other AI module wrapper already converts via sharp().png().toBuffer() before writing; face-landmarks was the only one that skipped this step.
This commit is contained in:
@@ -68,13 +68,14 @@ describe("detectFaceLandmarks", () => {
|
||||
);
|
||||
});
|
||||
|
||||
it("writes input buffer directly without sharp conversion", async () => {
|
||||
it("converts input buffer to PNG before writing", async () => {
|
||||
const sharp = (await import("sharp")).default;
|
||||
await detectFaceLandmarks(FAKE_INPUT);
|
||||
|
||||
// face-landmarks.ts does NOT use sharp -- it writes inputBuffer directly
|
||||
expect(sharp).toHaveBeenCalledWith(FAKE_INPUT);
|
||||
expect(writeFile).toHaveBeenCalledWith(
|
||||
expect.stringContaining("face_landmarks_"),
|
||||
FAKE_INPUT,
|
||||
Buffer.from("mock-png-data"),
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user