inline images: use CSS for max width, do not rescale if the image is smaller - gopherproxy-c - Gopher HTTP proxy in C (CGI)
 (HTM) git clone git://git.codemadness.org/gopherproxy-c
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit 641a71680cc507faa65a1b2c7384d1e3313119ef
 (DIR) parent 7b02f8a438e1b15796383f446d13f2c8c92d8501
 (HTM) Author: Hiltjo Posthuma <hiltjo@codemadness.org>
       Date:   Sun,  3 Aug 2025 21:42:08 +0200
       
       inline images: use CSS for max width, do not rescale if the image is smaller
       
       Otherwise an image would always get rescaled.
       
       Diffstat:
         M gopherproxy.c                       |       4 ++--
       
       1 file changed, 2 insertions(+), 2 deletions(-)
       ---
 (DIR) diff --git a/gopherproxy.c b/gopherproxy.c
       @@ -396,7 +396,7 @@ servedir(const char *server, const char *port, const char *path, const char *que
        
                                fputs("<img src=\"?q=", stdout);
                                encodeparam(uri);
       -                        fputs("\" width=\"400\" />", stdout);
       +                        fputs("\" />", stdout);
        
                                fputs("</a>", stdout);
                                break;
       @@ -743,7 +743,7 @@ main(void)
                fputs(
                        "Gopher HTTP proxy</title>\n"
                        "<style type=\"text/css\">\n"
       -                "a { text-decoration: none; } a:hover { text-decoration: underline; } img { vertical-align: middle; }\n"
       +                "a { text-decoration: none; } a:hover { text-decoration: underline; } img { vertical-align: middle; max-width: 400px; }\n"
                        "@media (prefers-color-scheme: dark) { body { background-color: #000; color: #bdbdbd; color-scheme: dark; } a { color: #56c8ff; } }\n"
                        "</style>\n"
                        "<meta name=\"robots\" content=\"noindex, nofollow\" />\n"