Demo Discussion
Forum Config Examples Contributions Vulnerabilities
  Discussion forum about ELOG  Not logged in ELOG logo
icon3.gif   images attached shown as inline , posted by Emiliano Gabrielli on Mon Feb 7 13:14:41 2005 
    icon2.gif   Re: images attached shown as inline , posted by Stefan Ritt on Mon Feb 7 13:34:17 2005 
       icon7.gif   Re: images attached shown as inline , posted by Emiliano Gabrielli on Mon Feb 7 14:06:48 2005 
          icon7.gif   Re: images attached shown as inline , posted by Stefan Ritt on Mon Feb 7 14:23:37 2005 
             icon5.gif   Re: images attached shown as inline , posted by Emiliano Gabrielli on Mon Feb 7 15:59:04 2005 
                icon2.gif   Re: images attached shown as inline , posted by Stefan Ritt on Mon Feb 7 21:07:58 2005 
                   icon4.gif   Re: images attached shown as inline , posted by Emiliano Gabrielli on Tue Feb 8 12:39:53 2005 
                      icon4.gif   Re: images attached shown as inline , posted by Stefan Ritt on Sat Feb 12 17:08:32 2005 scaling.gif
                         icon8.gif   Re: images attached shown as inline , posted by Emiliano Gabrielli on Wed Feb 16 08:58:47 2005 
                            icon2.gif   Re: images attached shown as inline , posted by Stefan Ritt on Wed Feb 16 09:02:09 2005 
                   icon12.gif   [patch] Re: images attached shown as inline , posted by Emiliano Gabrielli on Tue Feb 8 19:04:25 2005 
                      icon2.gif   [patch] Re: images attached shown as inline , posted by Stefan Ritt on Sat Feb 12 17:48:51 2005 
Message ID: 926     Entry time: Tue Feb 8 19:04:25 2005     In reply to: 914     Reply to this: 935
Icon: Blink  Author: Emiliano Gabrielli  Author Email: AlberT@SuperAlberT.it 
Category: Comment  OS: Linux  ELOG Version: 2.5.6 cvs 
Subject: [patch] Re: images attached shown as inline  
> > uhm ok .. can I expect to get a release with this feature in the near future ?
> 
> I checked how I would do that and did not find a good solution. If I put a
> 
> <img width=300 ...> 
> 
> for example, this scales down a big picture to only 300 pixels width. But if you submit a small
> picture, like just an icon, it blows it up to 300 pixels as well, which does not look nice.
> Unfortunatle I don't know of any option like "maxwidth=x" which only scales pictures down if they
> are larger than x. Do you know?

the following patch should do the job:


#################################################################################
--- elogd_orig.c        2005-02-03 16:46:10.000000000 +0100
+++ elogd_imgscale.c    2005-02-08 18:58:14.000000000 +0100
@@ -13690,9 +13690,14 @@
                       ("<tr><td colspan=%d class=\"attachment\">%s %d: <a href=\"%s\">%s</a>\n",
                        colspan, loc("Attachment"), index + 1, ref, attachment[index] + 14);
                   if (show_attachments)
-                     rsprintf
-                         ("</td></tr><tr><td colspan=%d class=\"messagelist\"><img
src=\"%s\"></td></tr>",
-                          colspan, ref);
+                     if (!getcfg(lbs->name, "Attached image width", str, sizeof(str))) {
+                        rsprintf("</td></tr><tr><td colspan=%d class=\"messagelist\"><img
src=\"%s\"></td></tr>",
+                                 colspan, ref);
+                    } else {
+                        rsprintf("</td></tr><tr><td colspan=%d class=\"messagelist\">"
+                                 "<div style=\"width: %s\"><img src=\"%s\" style=\"width:
100%\"></div></td></tr>",
+                                 colspan, str, ref);
+                    }
                } else {
                   rsprintf
                       ("<tr><td colspan=%d class=\"attachment\">%s %d: <a href=\"%s\">%s</a>\n",
@@ -18090,7 +18095,10 @@
                   if (is_image(att)) {
                      rsprintf("<tr><td class=\"messageframe\">\n");
                      rsprintf("<a name=\"att%d\"></a>\n", index + 1);
-                     rsprintf("<img src=\"%s\"></td></tr>", ref);
+                     if (!getcfg(lbs->name, "Attached image width entry", str, sizeof(str)))
+                        rsprintf("<img src=\"%s\"></td></tr>", ref);
+                    else
+                        rsprintf("<div style=\"width: %s\"><img src=\"%s\" style=\"width:
100%\"></div></td></tr>", str, ref);
                      rsprintf("</td></tr>\n\n");
                   } else {
                      if (is_ascii(file_name)) {
##########################################################################################

two new elog.conf parameters are defined:
Attached image width          ; width of full view image attached
Attached image width entry    ; width of attached image in the entry list view

plz apply :-)
ELOG V3.1.5-3fb85fa6