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:
commit
3a66e1bf9c
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user