Fixed problems with resize imgs when dont do it. Gitlab: #504
This commit is contained in:
parent
54d2ee6790
commit
cb2ff6e9f8
|
@ -1160,11 +1160,7 @@ function visual_map_print_item($mode = "read", $layoutData,
|
||||||
if (is_file($config['homedir'] . '/' . $img))
|
if (is_file($config['homedir'] . '/' . $img))
|
||||||
$infoImage = getimagesize($config['homedir'] . '/' . $img);
|
$infoImage = getimagesize($config['homedir'] . '/' . $img);
|
||||||
|
|
||||||
if ($height == 0 || $height == 0) {
|
if ($height !== 0 || $height !== 0) {
|
||||||
$height = '70px';
|
|
||||||
$width = '70px';
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$height = (integer)($proportion['proportion_height'] * $height);
|
$height = (integer)($proportion['proportion_height'] * $height);
|
||||||
$width = (integer)($proportion['proportion_width'] * $width);
|
$width = (integer)($proportion['proportion_width'] * $width);
|
||||||
}
|
}
|
||||||
|
@ -1172,40 +1168,28 @@ function visual_map_print_item($mode = "read", $layoutData,
|
||||||
|
|
||||||
$imgpos = '';
|
$imgpos = '';
|
||||||
|
|
||||||
if($layoutData['label_position']=='up'){
|
if ($layoutData['label_position']=='up') {
|
||||||
echo io_safe_output($text);
|
echo io_safe_output($text);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($layoutData['label_position']=='left'){
|
if ($layoutData['label_position']=='left') {
|
||||||
$imgpos = 'float:right';
|
$imgpos = 'float:right';
|
||||||
}
|
}
|
||||||
else if($layoutData['label_position']=='right'){
|
elseif ($layoutData['label_position']=='right') {
|
||||||
$imgpos = 'float:left';
|
$imgpos = 'float:left';
|
||||||
}
|
}
|
||||||
$varsize = getimagesize($img);
|
|
||||||
if ($width == 0 || $height == 0) {
|
if ($width == 0 || $height == 0) {
|
||||||
if($varsize[0] > 150 || $varsize[1] > 150){
|
echo html_print_image($img, true,
|
||||||
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,
|
|
||||||
array("class" => "image",
|
array("class" => "image",
|
||||||
"id" => "image_" . $id,
|
"id" => "image_" . $id,
|
||||||
"title" => $img_style_title,
|
"title" => $img_style_title,
|
||||||
"style" => $borderStyle.$imgpos), false,
|
"style" => $borderStyle.$imgpos), false,
|
||||||
false, false, $isExternalLink);
|
false, false, $isExternalLink);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
echo html_print_image($img, true,
|
echo html_print_image($img, true,
|
||||||
array("class" => "image",
|
array("class" => "image",
|
||||||
"id" => "image_" . $id,
|
"id" => "image_" . $id,
|
||||||
"width" => $width,
|
"width" => $width,
|
||||||
"height" => $height,
|
"height" => $height,
|
||||||
|
|
Loading…
Reference in New Issue