Page 1 of 1

zmu --image warning

Posted: Mon Dec 13, 2021 10:56 pm
by fahnoe
Hello,

I have a cronjob that periodically grabs the last image captured and saves it & this job has been littering the logs with the following warning:

Code: Select all

WAR Invalid index -1 passed. image_buffer_count = 3


This is coming from line 1178 of zm_monitor.cpp of zoneminder 1.36.11

My script uses

Code: Select all

zmu --image
to get the last image captured and this is valid based upon zmu(8) --image [image_index] - Write captured image to disk as <monitor_name>.jpg, last image captured or specified ring buffer index if given. But clearly someone didn't tell zm_monitor.cpp that it should expect to see -1 as an index:

Code: Select all

    if ( function & ZMU_IMAGE ) {
      if ( verbose ) {
        if ( image_idx == -1 )
          printf("Dumping last image captured to Monitor%d.jpg", monitor->Id());
        else
          printf("Dumping buffer image %d to Monitor%d.jpg", image_idx, monitor->Id());
        if ( scale != -1 )
          printf(", scaling by %d%%", scale);
        printf("\n");
      }
      monitor->GetImage(image_idx, scale>0?scale:100);
    }
--Larry

Re: zmu --image warning

Posted: Tue Dec 14, 2021 3:25 pm
by iconnor
Yeah in master it is a debug instead of a warning.

Looks like it still generates the image though.

Fix will be in 1.36.13

Re: zmu --image warning

Posted: Tue Dec 14, 2021 5:16 pm
by fahnoe
Yep, image is saved properly, it is just the message that is spurious. Thanks for the fix!

--Larry