zoneminder/tests
Isaac Connor 7d78b722d0 fix: auto-detect zone coordinate format instead of trusting Units field
The zone loader now ignores the Units DB field and detects the coordinate
format by checking for decimal points: decimal values are percentages,
integer-only values are legacy pixels. This fixes motion detection being
broken when zones had Units=Pixels but percentage coordinates (or vice
versa), which resulted in a ~99x99 pixel zone on a 2560x1440 monitor.

The PHP zone view now always forces Units=Percent when saving, since it
always works in percentage space. convertPixelPointsToPercent() now
returns bool to indicate whether conversion occurred.

Tests added for: truncation bug via atoi, correct percentage-to-pixel
conversion, auto-detect heuristic, and resolution independence.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 15:26:36 -04: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-23 18:16:55 -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: auto-detect zone coordinate format instead of trusting Units field 2026-03-08 15:26:36 -04:00