diff --git a/fhem/contrib/InfoPanel/55_InfoPanel.pm b/fhem/contrib/InfoPanel/55_InfoPanel.pm index 79691a88c..2ac191bdd 100644 --- a/fhem/contrib/InfoPanel/55_InfoPanel.pm +++ b/fhem/contrib/InfoPanel/55_InfoPanel.pm @@ -304,9 +304,23 @@ sub btIP_itemImg { return ""; } - ($width,$height,$mimetype,$data) = _btIP_imgData($data,$scale); + ($width,$height,$mimetype,undef) = _btIP_imgData($data,1); + if($mimetype eq 'image/svg+xml') { + if($data !~ m/viewBox/) { + $data =~ s/width=/viewBox="0 0 $width $height"\n\twidth=/; + } + ($width,$height) = _btIP_imgRescale($width,$height,$scale); + $data =~ s/width=".*"/width="$width"/; + $data =~ s/height=".*"/height="$height"/; + $scale = 1; + (undef,undef,undef,$data) = _btIP_imgData($data,$scale); + } else { + ($width,$height,$mimetype,$data) = _btIP_imgData($data,$scale); + } + +# $output = "\n"; $output = "\n"; - $output .= "\n"; + $output .= "\n"; return $output; }