zoneminder/tests
Isaac Connor b1ff22e58d fix: fall back to pixel parsing when zone Units=Percent but coords exceed 100
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>
2026-02-16 17:26:16 -05:00
..
data/fonts ZmFont: Store character padding in font file 2021-04-25 23:13:21 +02:00
CMakeLists.txt fix: fall back to pixel parsing when zone Units=Percent but coords exceed 100 2026-02-16 17:26:16 -05:00
main.cpp Update to Catch2 v3 2024-05-08 14:16:05 -04:00
zm_box.cpp Box: Make range calculations mathematically correct 2021-05-16 19:41:45 +02:00
zm_catch2.h Update to Catch2 v3 2024-05-08 14:16:05 -04:00
zm_comms.cpp Misc: Rename namespace ZM to zm 2021-06-06 19:11:11 +02:00
zm_crypt.cpp Crypto: Implement SHA1 hashing 2021-05-30 22:56:21 +02:00
zm_font.cpp tests/Font: Avoid lambda capture initialization 2021-05-24 00:55:46 +02:00
zm_onvif_renewal.cpp refactor: move format_absolute_time_iso8601 from zm_monitor_onvif to zm_time 2026-02-12 16:53:39 -05:00
zm_poly.cpp Polygon: Perform clip operation on existing object instead of returning a new clipped one 2021-05-16 19:42:41 +02:00
zm_utils.cpp Fix appending %% instead of % when uri decoding. Add test for URIEncode 2026-02-04 20:45:46 -05:00
zm_vector2.cpp Polygon: Implement clipping to a boundary box 2021-05-16 19:41:45 +02:00
zm_zone.cpp fix: fall back to pixel parsing when zone Units=Percent but coords exceed 100 2026-02-16 17:26:16 -05:00