1
0
mirror of https://github.com/git/git.git synced 2024-10-22 11:18:17 +02:00

Merge branch 'ak/gitweb-fit-image'

Instead of allowing an <img> to be shown in whatever size, force
scaling it to fit on the page with max-height/max-width css style
attributes.

* ak/gitweb-fit-image:
  gitweb: Avoid overflowing page body frame with large images
This commit is contained in:
Junio C Hamano 2014-03-14 14:25:28 -07:00
commit 3a66e1bf9c
2 changed files with 6 additions and 1 deletions

@ -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!"!;
}

@ -32,6 +32,11 @@ img.avatar {
vertical-align: middle;
}
img.blob {
max-height: 100%;
max-width: 100%;
}
a.list img.avatar {
border-style: none;
}