From cb2ff6e9f8a96968e798a072736a7ccf91247d3b Mon Sep 17 00:00:00 2001 From: m-lopez-f Date: Thu, 9 Mar 2017 12:50:51 +0100 Subject: [PATCH] Fixed problems with resize imgs when dont do it. Gitlab: #504 --- .../include/functions_visual_map.php | 32 +++++-------------- 1 file changed, 8 insertions(+), 24 deletions(-) diff --git a/pandora_console/include/functions_visual_map.php b/pandora_console/include/functions_visual_map.php index ad38e4a4e9..c4767a3e16 100755 --- a/pandora_console/include/functions_visual_map.php +++ b/pandora_console/include/functions_visual_map.php @@ -1160,11 +1160,7 @@ function visual_map_print_item($mode = "read", $layoutData, if (is_file($config['homedir'] . '/' . $img)) $infoImage = getimagesize($config['homedir'] . '/' . $img); - if ($height == 0 || $height == 0) { - $height = '70px'; - $width = '70px'; - } - else { + if ($height !== 0 || $height !== 0) { $height = (integer)($proportion['proportion_height'] * $height); $width = (integer)($proportion['proportion_width'] * $width); } @@ -1172,40 +1168,28 @@ function visual_map_print_item($mode = "read", $layoutData, $imgpos = ''; - if($layoutData['label_position']=='up'){ + if ($layoutData['label_position']=='up') { echo io_safe_output($text); } - if($layoutData['label_position']=='left'){ + if ($layoutData['label_position']=='left') { $imgpos = 'float:right'; } - else if($layoutData['label_position']=='right'){ + elseif ($layoutData['label_position']=='right') { $imgpos = 'float:left'; } - $varsize = getimagesize($img); + if ($width == 0 || $height == 0) { - if($varsize[0] > 150 || $varsize[1] > 150){ - echo html_print_image($img, true, - array("class" => "image", - "id" => "image_" . $id, - "width" => "70px", - "height" => "70px", - "title" => $img_style_title, - "style" => $borderStyle.$imgpos), false, - false, false, $isExternalLink); - } - else{ - echo html_print_image($img, true, + echo html_print_image($img, true, array("class" => "image", "id" => "image_" . $id, "title" => $img_style_title, "style" => $borderStyle.$imgpos), false, false, false, $isExternalLink); - } } else{ - echo html_print_image($img, true, - array("class" => "image", + echo html_print_image($img, true, + array("class" => "image", "id" => "image_" . $id, "width" => $width, "height" => $height,