Hi i just fixed a smal bug in the scaling code. As fas as I can see it is in al versions from 1.21.0 up to current version.
( original image size 358x288, scale factor 86, gives an shift every line of 1 pixel ).
--- zm_image.cpp 2006-05-08 14:46:53.000000000 +0200
+++ zm_image_new.cpp 2006-08-25 10:20:38.000000000 +0200
@@ -1490,7 +1490,8 @@
else
{
unsigned int inv_factor = (ZM_SCALE_SCALE*ZM_SCALE_SCALE)/factor;
- unsigned char *pd = scale_buffer;
+ unsigned char *mpd = scale_buffer;
+ unsigned int nwc = new_width*colours;
unsigned int wc = width*colours;
unsigned int xstart = factor/2;
unsigned int ystart = factor/2;
@@ -1508,6 +1509,9 @@
unsigned int w_index;
unsigned char *ps = &buffer[y*wc];
+ mpd+=nwc;
+ unsigned char *pd=mpd;
for ( unsigned int x = 0; x < width; x++ )
{
w_count += factor;
fixed a small scaling bug.
- zoneminder
- Site Admin
- Posts: 5215
- Joined: Wed Jul 09, 2003 2:07 pm
- Location: Bristol, UK
- Contact:
test environment
It is quite easy. Put a cam to record at 358x288 / 360x288. Use the cgi script to test:
cgi-bin/zms?mode=single&monitor=2&scale=86&.......< al the other vars >
I have tested at different scale factors, it is not always visible. But the above numbers showed it for me.
cgi-bin/zms?mode=single&monitor=2&scale=86&.......< al the other vars >
I have tested at different scale factors, it is not always visible. But the above numbers showed it for me.