mirror of
https://github.com/storytold/photocraft.git
synced 2026-11-21 09:26:43 +00:00
From an adversarial review of the Content-Aware Scale speed-up: - resize_bilinear with zero channels panicked (chunk size 0) since the previous commit; it, carve_with and carve_width_with now return early when there are no pixels or channels, or fewer values than the size says (sizes checked with checked_mul). carve with an empty width and a height change, and a protection map shorter than the image (now ignored), panicked before this series too. - With NaN in the energy map, which seam was chosen depended on the NaN payload, and that differed between builds. NaN samples now give the highest energy and NaN protection protects nothing, so costs are never NaN; outputs without NaN are unchanged (all pins match). Tests: degenerate_inputs_do_not_panic and nan_payloads_do_not_steer_seams (both failed before), proxy_rebuild_observes_cancellation (a cancel during the tall-image rebuild), and NaN/inf cases in incremental_dp_matches_full_dp. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LELc5BQzgV5dA7dxdMejkK