refactor: improve tool processing, dropzone, seam carving, and format encoding

- Refactor use-tool-processor and use-pipeline-processor hooks
- Enhance dropzone component with improved UX
- Improve seam carving with better error handling and tests
- Add JXL format encoding support to format-encoders
- Update tool routes for consistent format handling
- Add dropzone unit tests
This commit is contained in:
SnapOtter
2026-05-11 21:57:40 +08:00
parent 656a8d3d44
commit b06906025c
25 changed files with 1368 additions and 436 deletions
+3 -4
View File
@@ -1307,11 +1307,10 @@ describe("seamCarve", () => {
);
});
it("rejects reductions larger than 75%", async () => {
it("pre-resizes when reduction exceeds 75% instead of rejecting", async () => {
// 800x600, requesting width: 100 => ratio 0.125 < 0.25
await expect(seamCarve(INPUT_BUFFER, OUTPUT_DIR, { width: 100 })).rejects.toThrow(
"cannot reduce dimensions by more than 75%",
);
// Should succeed by pre-resizing to bring within 75% limit
await expect(seamCarve(INPUT_BUFFER, OUTPUT_DIR, { width: 100 })).resolves.toBeDefined();
});
it("uses original dimensions when width/height not specified", async () => {