zmu --image warning

Discussions related to the 1.36.x series of ZoneMinder
Post Reply
fahnoe
Posts: 11
Joined: Tue Feb 15, 2011 1:32 pm

zmu --image warning

Post 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
User avatar
iconnor
Posts: 3269
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: zmu --image warning

Post 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
fahnoe
Posts: 11
Joined: Tue Feb 15, 2011 1:32 pm

Re: zmu --image warning

Post by fahnoe »

Yep, image is saved properly, it is just the message that is spurious. Thanks for the fix!

--Larry
Post Reply