From 30094b73044f3e97e4ab98ba84b85daacd070dbb Mon Sep 17 00:00:00 2001 From: Steve Gilvarry Date: Thu, 23 Jul 2026 05:18:30 +1000 Subject: [PATCH] fix: only write analysis jpegs for alarm frames refs #4996 Since the 1.38 analysis pipeline, every analysed packet carries an analysis_image so the live analysis view can show full colour. Event AddFrame wrote an analysis jpeg whenever the packet had one, so SaveJPEGs 'Analysis images only' saved every frame of the event instead of only alarmed frames as in 1.36. Gate the write on frame_type == ALARM to restore the old behaviour. Co-Authored-By: Claude Opus 4.8 --- src/zm_event.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/zm_event.cpp b/src/zm_event.cpp index 1fb1b2ac66..7415183edd 100644 --- a/src/zm_event.cpp +++ b/src/zm_event.cpp @@ -608,7 +608,10 @@ void Event::AddFrame(const std::shared_ptr&packet) { } } // end if is an alarm frame - if (save_jpegs & 2) { + // Only write analysis jpegs for alarm frames. Since 1.38 every analysed + // packet carries an analysis_image (for the live analysis view), so + // writing whenever one exists would save every frame of the event. + if ((save_jpegs & 2) and (frame_type == ALARM)) { if (packet->analysis_image) { std::string event_file = stringtf(staticConfig.analyse_file_format.c_str(), path.c_str(), frames); Debug(1, "Writing analysis frame %d to %s", frames, event_file.c_str());