From: Andrew Keller Date: Fri, 07 Feb 2014 03:31:20 GMT Subject: [PATCH] gitweb: Avoid overflowing page body frame with large images Message-ID: <2452A253-A926-4A40-9F08-6E28EFF229F3@kellerfarm.com> 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 B Keller --- I recently used Git to archive a set of scanned photos, and I used gitweb to provide access to them. Overall, everything worked well, but I found it undesirable that I had to zoom out in my browser on every photo to see the whole photo. In the spirit of making the default behavior the most likely correct behavior, this patch seems to be a good idea. However, I'm not an expert on the use cases of gitweb. In order for the maximum size constraints to take effect, the image would have to be at least the size of the web browser window (minus a handful of pixels), so the affected images are usually going to be pretty big. Are there any common use cases for displaying a large image without scaling (and hence, with scrolling)? Thanks, Andrew gitweb/gitweb.perl | 2 +- gitweb/static/gitweb.css | 5 +++++ 2 files changed, 6 insertions(+), 1 deletions(-) diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index 3bc0f0b..2c6a77f 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 "
\n"; if ($mimetype =~ m!^image/!) { - print qq!