ZM_EVENT_IMAGE_DIGITS broken in 1.19.2?
ZM_EVENT_IMAGE_DIGITS broken in 1.19.2?
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)
- zoneminder
- Site Admin
- Posts: 5215
- Joined: Wed Jul 09, 2003 2:07 pm
- Location: Bristol, UK
- Contact:
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
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