Zone drawing outside camera resolution

Forum for questions and support relating to the 1.24.x releases only.
Post Reply
Posts: 2
Joined: Tue Apr 10, 2007 5:07 pm

Zone drawing outside camera resolution

Post by ovkolsi » Thu Jun 09, 2011 10:34 am

Noticed following with both zoneminder 1.24.3 (from Fedora 15 package) and 1.24.4 SVN version:

I have Axis camera with 640x480 resolution. When drawing zones, one can easily put a point to invalid position, for example to X coordinate 642 when drawing very closely to the border of the image. This kind of value can further be saved.

Then later when "zma" process is restarted, it starts to crash immediately with signal 134. Drawing part of this problem happens within Fedora 15 with both Firefox 4 and Chrome 12. There's a room for improvements:

- if possible, do not let user to draw "outside" the correct region
- if/when data points are manually entered, do some validation
- latest do some validation when values are saved to database
- improve "zma" process so that it doesn't crash with this kind of zone definition

Posts: 679
Joined: Wed Dec 16, 2009 4:32 pm
Location: Israel

Re: Zone drawing outside camera resolution

Post by mastertheknife » Thu Jun 09, 2011 11:07 am


This is a known issue.
I think zma shouldn't clamp the zone coordinates, but instead, the bad zone coordinates shouldn't be stored on the database at the first place!
There is some javascript validation for the zone coordinates, but it doesn't appear to be working. So if Phil or anyone else will try fixing it, it will be awesome :D

Kfir Itzhak.

User avatar
Posts: 219
Joined: Sun Aug 17, 2008 5:34 am
Location: Rosario - Argentina

Re: Zone drawing outside camera resolution

Post by Normando » Tue Jun 14, 2011 7:41 pm

A dirty fix:

Code: Select all

--- ./web/skins/classic/views/zone.php.orig	2011-02-25 12:55:49.000000000 -0300
+++ ./web/skins/classic/views/zone.php	2011-02-26 21:17:11.000000000 -0300
@@ -212,7 +212,7 @@
         <div id="definitionPanel">
           <div id="imagePanel">
-            <div id="imageFrame" style="width: <?= reScale( $monitor['Width'], $scale ) ?>px; height: <?= reScale( $monitor['Height'], $scale ) ?>px;">
+            <div id="imageFrame" style="width: <?= reScale( $monitor['Width'] - 3, $scale ) ?>px; height: <?= reScale( $monitor['Height'] - 3, $scale ) ?>px;">
               <img name="zoneImage" id="zoneImage" src="<?= $zoneImage ?>" width="<?= reScale( $monitor['Width'], $scale ) ?>" height="<?= reScale( $monitor['Height'], $scale ) ?>" alt="Zone Image"/>

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests