#480 closed patch (fixed)

sub calculate_png_size in munin-html is not capable of calculating right width/height for rrdtools 1.2.11

Reported by: rune,skillingstad@… Owned by: janl
Priority: normal Milestone: Munin 1.4
Component: master Version:
Severity: minor Keywords: cgi scale html img tag
Cc:

Description

As I tried to use graph_strategy cgi on my munin server (running SuSE Linux 10.0), I started to notice that the fonts seemed wrong. A closer inspection revealed that the problems was not fonts, but munin-htmls ability to predict cgi-rendered graphs when using rrdtools 1.2.11

I have tried to play with the values to predict correct size, and come up with a patch to fix this with rrdtools 1.2.11.

I have not tested this on other distributions or other versions of rrdtool, but I guess this is due to the ttf font that rrdtool 1.2.x uses.

I would suggest rewriting the whole &calculate_png_size(). An approach that I think might work, would be to check if cached image is on disk, and use existing &get_png_size() on cache, and skip height and weight attributes if there is no file. Most of the time, there will be a cache. The few times there is no such file, I could live with the graph being loaded "strage" without size attributes, if all my graphs would look all right when they were loaded.

Attachments (3)

munin-html.patch (1.6 KB) - added by rune.skillingstad@… at 2007-01-08T22:57:55+01:00.
patch for rrdtools 1.2.11
munin-html-use-cache-img-size-for-cgi.diff (2.7 KB) - added by blueyed at 2008-05-11T03:00:46+02:00.
Patch to use the image size for existing files also for "cgi". Additionally removes obsolete calculate_png_size function
munin-html.2.patch (770 bytes) - added by human at 2009-01-15T07:28:47+01:00.
cgi proper size patch for debian stable (etch)

Download all attachments as: .zip

Change History (9)

Changed at 2007-01-08T22:57:55+01:00 by rune.skillingstad@…

patch for rrdtools 1.2.11

comment:1 Changed at 2007-02-12T22:49:15+01:00 by janl

  • Owner changed from nobody to janl
  • Status changed from new to assigned
  • Type changed from defect to patch

comment:2 Changed at 2007-09-25T22:46:57+02:00 by janl

  • Resolution set to fixed
  • Status changed from assigned to closed

munin-html no longer generates width/height attributes in cgi mode. (since a while ago)

comment:3 Changed at 2008-05-11T02:58:30+02:00 by blueyed

  • Resolution fixed deleted
  • Status changed from closed to reopened

Well, it's still being inserted in 1.2.5 in Debian/Ubuntu?, and I can confirm that the patch helped. I had to adjust the height+17 though.

For the other idea, using no width/height by default, but using them from cached files, I can confirm that this works and is quite easy to implement.

I'll attach a patch against SVN trunk. Please consider applying it.

Changed at 2008-05-11T03:00:46+02:00 by blueyed

Patch to use the image size for existing files also for "cgi". Additionally removes obsolete calculate_png_size function

comment:4 Changed at 2009-01-15T07:28:19+01:00 by human

i confirm the later patch works for me under debian stable (although it doesn't apply cleanly) and is very useful to get nice graphs again. otherwise they look terrible.

I'll attach my crappy patch.

Changed at 2009-01-15T07:28:47+01:00 by human

cgi proper size patch for debian stable (etch)

comment:5 Changed at 2009-10-21T01:28:02+02:00 by janl

  • Milestone set to Munin 1.4
  • Version 1.2.5 deleted

comment:6 Changed at 2009-10-28T02:26:35+01:00 by janl

  • Resolution set to fixed
  • Status changed from reopened to closed

Blueyed's patch applied in r2735. Thanks a lot!

Note: See TracTickets for help on using tickets.