[solved] scaling up in view mode only stretches the image

Forum for questions and support relating to the 1.27.x releases only.
Locked
hesral
Posts: 44
Joined: Sun Apr 06, 2014 12:11 pm

[solved] scaling up in view mode only stretches the image

Post by hesral »

When I open a monitor set to be scaled 1/2* when viewing, the image get larger, but it seems that the image just got stretched to the new size. This is very noticeable on the timestamp, as it is totally unreadable, as a consequence of the descaling that I believe had occurred before the image got stretched. If I reload the view page it just goes back to the default 1/2* scale again. If I do the opposite, start off with a 100% scale, and descales to 1/2*, the image seems to be resized correctly, as the framerate increase over my slow connection.

Is this as intended, and is it something I can fix in the config?

This happens on zoneminder 1.27 on ubuntu server 12.04 using the iconnor ppa.
Last edited by hesral on Thu Apr 24, 2014 4:28 am, edited 1 time in total.
hesral
Posts: 44
Joined: Sun Apr 06, 2014 12:11 pm

Re: scaling up in view mode only stretches the image

Post by hesral »

I fixed this for the classic skin by adding a line to the end of function changeScale() in /usr/share/zoneminder/skins/classic/views/js/watch.js

the line I added was:

Code: Select all

streamImg.src = streamImg.src.replace(/&scale=\d+&/, "&scale=" + scale + "&");
It takes image source string, replaces the scale value by the new value, and set the image source value again to the new string.
Works like a charm for me, but it would be nice if some developer can have a look, and tell me if I broke something.
jHeron
Posts: 73
Joined: Sun Jun 16, 2013 5:06 pm

Re: [solved] scaling up in view mode only stretches the imag

Post by jHeron »

Thanks for posting your solution!
Now I see where to fix MY scaling issue, I posted about it here:
http://www.zoneminder.com/forums/viewto ... 31&t=22156
Cheers,
Jon
Locked