mirror of
https://github.com/storytold/photocraft.git
synced 2026-10-28 18:22:06 +01:00
slice.divide clamped each axis to 1..1000 but checked no total, so one request made up to a million slices, and resolving the slice list (slices::resolve, used by slice.list and export) is quadratic in the slice count: about 5e11 rectangle visits at a million. A division over 10000 parts (100 x 100) is now refused with a bad-params error before any part is created; the params doc says so. Resolving 10000 slices is about 5e7 visits, and the test lists them in well under a second. The test refuses 101 x 100, 100 x 101 and 1000 x 1000 with the slices and history unchanged, then divides 100 x 100 into 10000 parts and lists them. Before the fix 101 x 100 was accepted (10100 parts). Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>