Re: [MonAMI-users] unable to see some graphs
Status: Alpha
Brought to you by:
paulmillar
From: Arnau B. <arn...@pi...> - 2009-07-28 13:20:52
|
Hi all, > arnau@lx-arnau ~ $ hexdump -C torque-graph.png | head -20 > 00000000 0a 89 50 4e 47 0d 0a 1a 0a 00 00 00 0d 49 48 44 > |..PNG........IHD| 00000010 52 00 00 01 8d 00 00 00 ac 08 06 00 00 > 00 87 20 |R.............. | 00000020 f0 f6 00 00 00 4a 74 45 58 74 > 53 6f 66 74 77 61 |.....JtEXtSoftwa| 00000030 72 65 00 52 52 44 74 > 6f 6f 6c 2c 20 54 6f 62 69 |re.RRDtool, Tobi| 00000040 61 73 20 4f > 65 74 69 6b 65 72 20 3c 74 6f 62 69 |as Oetiker <tobi| > > good one (generated with rrdtool) > > arnau@lx-arnau ~ $ hexdump -C rrdoutput | head -20 > 00000000 89 50 4e 47 0d 0a 1a 0a 00 00 00 0d 49 48 44 52 > |.PNG........IHDR| 00000010 00 00 02 b9 00 00 00 e9 08 06 00 00 00 > 20 4f 2f |............. O/| 00000020 6a 00 00 00 4a 74 45 58 74 53 > 6f 66 74 77 61 72 |j...JtEXtSoftwar| 00000030 65 00 52 52 44 74 6f > 6f 6c 2c 20 54 6f 62 69 61 |e.RRDtool, Tobia| 00000040 73 20 4f 65 > 74 69 6b 65 72 20 3c 74 6f 62 69 40 |s Oetiker <tobi@| > > > notice that bad one starts with ..PNG and the good one with .PNG (0a > 89 50 vs 89 50) > > I've opened it with mc and saw some blank line at the beggining of the > file. After removing it, the png is displayed again. > > What could be insertering that blank line? in multiple-graphs.php function mg_pref_order_cmp($a, $b) { if ($a == $b) return 0; global $mg_preferred_order; static $pref_values; if (!$pref_values) $pref_values = array_values($mg_preferred_order); $x = array_search($a, $pref_values); $y = array_search($b, $pref_values); $found_x = ($x !== FALSE) && ($x !== NULL); $found_y = ($y !== FALSE) && ($y !== NULL); if( $found_x && $found_y) return ($x < $y ? -1 : 1); if( $found_x) return -1; if( $found_y) return 1; return $a < $b ? -1 : 1; } return (0); ^^^^^^^^^^^^^ that return (0); does the trick... Thanks to all for the help! Cheers, Arnau |