Ticket #480 (closed patch: fixed)

Opened 4 years ago

Last modified 10 months ago

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

Reported by: rune,skillingstad@ntnu.no Assigned to: 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

munin-html.patch (1.6 kB) - added by rune.skillingstad@ntnu.no on 01/08/07 22:57:55.
patch for rrdtools 1.2.11
munin-html-use-cache-img-size-for-cgi.diff (2.7 kB) - added by blueyed on 05/11/08 03:00:46.
Patch to use the image size for existing files also for "cgi". Additionally removes obsolete calculate_png_size function
munin-html.2.patch (0.8 kB) - added by human on 01/15/09 07:28:47.
cgi proper size patch for debian stable (etch)

Change History

01/08/07 22:57:55 changed by rune.skillingstad@ntnu.no

  • attachment munin-html.patch added.

patch for rrdtools 1.2.11

02/12/07 22:49:15 changed by janl

  • owner changed from nobody to janl.
  • status changed from new to assigned.
  • type changed from defect to patch.

09/25/07 22:46:57 changed by janl

  • status changed from assigned to closed.
  • resolution set to fixed.

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

05/11/08 02:58:30 changed by blueyed

  • status changed from closed to reopened.
  • resolution deleted.

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.

05/11/08 03:00:46 changed by blueyed

  • attachment munin-html-use-cache-img-size-for-cgi.diff added.

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

01/15/09 07:28:19 changed 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.

01/15/09 07:28:47 changed by human

  • attachment munin-html.2.patch added.

cgi proper size patch for debian stable (etch)

10/21/09 01:28:02 changed by janl

  • version deleted.
  • milestone set to Munin 1.4.

10/28/09 02:26:35 changed by janl

  • status changed from reopened to closed.
  • resolution set to fixed.

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