summaryrefslogtreecommitdiff
path: root/gitweb/gitweb.perl
diff options
context:
space:
mode:
authorAndrew Keller <andrew@kellerfarm.com>2014-02-17 14:25:13 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-02-20 17:50:14 (GMT)
commit46a7471f0e20af9d2efcc4a14c76d537e1551ac9 (patch)
tree7f9564d4ab8ffae8e56093916478b26ebf6afd9a /gitweb/gitweb.perl
parent5f95c9f850b19b368c43ae399cc831b17a26a5ac (diff)
downloadgit-46a7471f0e20af9d2efcc4a14c76d537e1551ac9.zip
git-46a7471f0e20af9d2efcc4a14c76d537e1551ac9.tar.gz
git-46a7471f0e20af9d2efcc4a14c76d537e1551ac9.tar.bz2
gitweb: Avoid overflowing page body frame with large images
When displaying a blob in gitweb, if it's an image, specify constraints for maximum display width and height to prevent the image from overflowing the frame of the enclosing page_body div. This change assumes that it is more desirable to see the whole image without scrolling (new behavior) than it is to see every pixel without zooming (previous behavior). Signed-off-by: Andrew Keller <andrew@kellerfarm.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'gitweb/gitweb.perl')
-rwxr-xr-xgitweb/gitweb.perl2
1 files changed, 1 insertions, 1 deletions
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 3bc0f0b..79057b7 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -7094,7 +7094,7 @@ sub git_blob {
git_print_page_path($file_name, "blob", $hash_base);
print "<div class=\"page_body\">\n";
if ($mimetype =~ m!^image/!) {
- print qq!<img type="!.esc_attr($mimetype).qq!"!;
+ print qq!<img class="blob" type="!.esc_attr($mimetype).qq!"!;
if ($file_name) {
print qq! alt="!.esc_attr($file_name).qq!" title="!.esc_attr($file_name).qq!"!;
}