ZM_EVENT_IMAGE_DIGITS broken in 1.19.2?

Support and queries relating to all previous versions of ZoneMinder
Locked
karlg
Posts: 23
Joined: Wed Mar 24, 2004 11:23 am

ZM_EVENT_IMAGE_DIGITS broken in 1.19.2?

Post by karlg »

seems that ZM_EVENT_IMAGE_DIGITS is not being read properly by ZM backend when writing out the image .jpgs out into the events/#### dir. ever since upgrading, it does not properly write preceeding 0's to the file names, if ZM_EVENT_IMAGE_DIGITS is set to >2. (setting this value to "1" seems to solve the problem making new events viewable, but, if you have events saved/archived they will be broken)
karlg
Posts: 23
Joined: Wed Mar 24, 2004 11:23 am

Post by karlg »

Bah! This posted in the wrong forum. Phil? can you move it to "ZoneMinder 1.19.x"? plz?
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

Moved as requested.

I'll look into this. What setting do you have and what do you see in terms of what are the images called?

Have you remembered to restart after changing the value?

Phil,
karlg
Posts: 23
Joined: Wed Mar 24, 2004 11:23 am

Post by karlg »

when first installing zm (back about 3 months ago) i specified "3" (not sure if that is the default) for ZM_EVENT_IMAGE_DIGITS. Previous versions would write all the *-[capture/analyze].jpg files out with a preceeding 0 for the first 99 files. seems 1.19.2 doesn't do that (at least in my install) Restarting doesn't seem to fix it either.

my quick and dirty workaround has been changing ZM_EVENT_IMAGE_DIGITS to "1", and writing a quick shell script to strip the preceeding 0's to make my old (pre upgrade) events viewable.

Karl

Code: Select all

#!/bin/bash

dezero () {
  if [ "$(basename $1 | cut -c1)" == "0" ]; then
    echo $(dezero "$(dirname $1)/$(basename $1 | cut -c2-)")
  else
    echo $1
  fi
}

for file in $(find ./ -type f -name '0??-*.jpg'); do
  mv -v $file $(dezero $file)
done
Locked