diff --git a/rhodecode/lib/helpers.py b/rhodecode/lib/helpers.py --- a/rhodecode/lib/helpers.py +++ b/rhodecode/lib/helpers.py @@ -1617,18 +1617,19 @@ def render_binary(repo_name, file_obj): Choose how to render a binary file """ + # unicode filename = file_obj.name # images - for ext in ['*.png', '*.jpg', '*.ico', '*.gif']: + for ext in ['*.png', '*.jpeg', '*.jpg', '*.ico', '*.gif']: if fnmatch.fnmatch(filename, pat=ext): - alt = escape(filename) src = route_path( 'repo_file_raw', repo_name=repo_name, commit_id=file_obj.commit.raw_id, f_path=file_obj.path) + return literal( - ''.format(alt, src)) + ''.format(src)) def renderer_from_filename(filename, exclude=None): diff --git a/rhodecode/public/css/code-block.less b/rhodecode/public/css/code-block.less --- a/rhodecode/public/css/code-block.less +++ b/rhodecode/public/css/code-block.less @@ -500,7 +500,7 @@ div.codeblock { img.rendered-binary { height: auto; - width: 100%; + width: auto; } .markdown-block { diff --git a/rhodecode/templates/files/files_source.mako b/rhodecode/templates/files/files_source.mako --- a/rhodecode/templates/files/files_source.mako +++ b/rhodecode/templates/files/files_source.mako @@ -115,7 +115,9 @@ %if c.file.is_binary: <% rendered_binary = h.render_binary(c.repo_name, c.file)%> % if rendered_binary: +