mirror of
https://github.com/ZoneMinder/zoneminder.git
synced 2026-03-26 09:42:42 -04:00
When zones have Units='Percent' in the database but their Coords contain pixel values (>100), ParsePercentagePolygon treats them as percentages, causing wild scaling (e.g., 639% * 1920 / 100 = 12269) followed by clamping to monitor bounds, producing degenerate full-frame zones. Add a pre-check in Zone::Load that scans coordinate values before calling ParsePercentagePolygon. If any value exceeds 100, log a warning and use ParsePolygonString (pixel path) instead. Also add unit tests for both ParsePolygonString and ParsePercentagePolygon. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>