diff --git a/kallithea/lib/vcs/nodes.py b/kallithea/lib/vcs/nodes.py --- a/kallithea/lib/vcs/nodes.py +++ b/kallithea/lib/vcs/nodes.py @@ -422,6 +422,14 @@ class FileNode(Node): _bin = '\0' in self._get_content() return _bin + def is_browser_compatible_image(self): + return self.mimetype in [ + "image/gif", + "image/jpeg", + "image/png", + "image/bmp" + ] + @LazyProperty def extension(self): """Returns filenode extension""" diff --git a/kallithea/public/css/style.css b/kallithea/public/css/style.css --- a/kallithea/public/css/style.css +++ b/kallithea/public/css/style.css @@ -5122,6 +5122,12 @@ div.comment:target>.comment-wrapp { margin: -2px; } +.img-preview { + max-width: 100%; + height: auto; + margin: 5px; +} + div.prev-next-comment div.prev-comment, div.prev-next-comment div.next-comment { display: inline-block; diff --git a/kallithea/templates/files/files_source.html b/kallithea/templates/files/files_source.html --- a/kallithea/templates/files/files_source.html +++ b/kallithea/templates/files/files_source.html @@ -56,12 +56,14 @@