we shall always pass width & height as pixels without units.

This commit is contained in:
Isaac Connor 2018-07-31 16:55:13 -04:00
parent b20d61e0df
commit c934295bf9
2 changed files with 6 additions and 6 deletions

View File

@ -227,7 +227,7 @@ function getImageStreamHTML( $id, $src, $width, $height, $title='' ) {
if ( canStreamIframe() ) { if ( canStreamIframe() ) {
return '<iframe id="'.$id.'" src="'.$src.'" alt="'. validHtmlStr($title) .'" '.($width? ' width="'. validInt($width).'"' : '').($height?' height="'.validInt($height).'"' : '' ).'/>'; return '<iframe id="'.$id.'" src="'.$src.'" alt="'. validHtmlStr($title) .'" '.($width? ' width="'. validInt($width).'"' : '').($height?' height="'.validInt($height).'"' : '' ).'/>';
} else { } else {
return '<img id="'.$id.'" src="'.$src.'" alt="'. validHtmlStr($title) .'" style="'.($width? ' width:'.$width.';' : '' ).($height ? ' height:'. $height.';' : '' ).'"/>'; return '<img id="'.$id.'" src="'.$src.'" alt="'. validHtmlStr($title) .'" style="'.($width? ' width:'.$width.'px;' : '' ).($height ? ' height:'. $height.'px;' : '' ).'"/>';
} }
} }
@ -2137,15 +2137,15 @@ function getStreamHTML( $monitor, $options = array() ) {
if ( isset($options['scale']) and $options['scale'] and ( $options['scale'] != 100 ) ) { if ( isset($options['scale']) and $options['scale'] and ( $options['scale'] != 100 ) ) {
//Warning("Scale to " . $options['scale'] ); //Warning("Scale to " . $options['scale'] );
$options['width'] = reScale( $monitor->Width(), $options['scale'] ) . 'px'; $options['width'] = reScale( $monitor->Width(), $options['scale'] );
$options['height'] = reScale( $monitor->Height(), $options['scale'] ) . 'px'; $options['height'] = reScale( $monitor->Height(), $options['scale'] );
} else { } else {
# scale is empty or 100 # scale is empty or 100
# There may be a fixed width applied though, in which case we need to leave the height empty # There may be a fixed width applied though, in which case we need to leave the height empty
if ( ! ( isset($options['width']) and $options['width'] ) ) { if ( ! ( isset($options['width']) and $options['width'] ) ) {
$options['width'] = $monitor->Width() . 'px'; $options['width'] = $monitor->Width();
if ( ! ( isset($options['height']) and $options['height'] ) ) { if ( ! ( isset($options['height']) and $options['height'] ) ) {
$options['height'] = $monitor->Height() . 'px'; $options['height'] = $monitor->Height();
} }
} else if ( ! isset($options['height']) ) { } else if ( ! isset($options['height']) ) {
$options['height'] = ''; $options['height'] = '';

View File

@ -202,7 +202,7 @@ foreach ( $monitors as $monitor ) {
onclick="createPopup('?view=watch&amp;mid=<?php echo $monitor->Id() ?>', 'zmWatch<?php echo $monitor->Id() ?>', 'watch', <?php echo reScale( $monitor->Width(), $monitor->PopupScale() ); ?>, <?php echo reScale( $monitor->Height(), $monitor->PopupScale() ); ?> );"> onclick="createPopup('?view=watch&amp;mid=<?php echo $monitor->Id() ?>', 'zmWatch<?php echo $monitor->Id() ?>', 'watch', <?php echo reScale( $monitor->Width(), $monitor->PopupScale() ); ?>, <?php echo reScale( $monitor->Height(), $monitor->PopupScale() ); ?> );">
<?php <?php
$monitor_options = $options; $monitor_options = $options;
if ( $Positions ) { if (0 and $Positions ) {
$monitor_options['width'] = '100%'; $monitor_options['width'] = '100%';
$monitor_options['height'] = '100%'; $monitor_options['height'] = '100%';
if ( 0 ) { if ( 0 ) {