From: Ian Jackson Date: Tue, 20 Jul 2010 11:25:12 +0000 (+0100) Subject: provide width and height attributes for imgs X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ijackson/git?a=commitdiff_plain;h=e4ac7a00a14ee6b89ea1e6ed2682461adb0679b3;p=rrd-graphs.git provide width and height attributes for imgs --- diff --git a/cgi b/cgi index 1d29b1d..f95567d 100755 --- a/cgi +++ b/cgi @@ -397,13 +397,16 @@ sub num_param ($$$$) { our $group= param('graph'); +my $defwidth= 370; +my $defheight= 200; + our $elem= param('elem'); if (defined $elem) { my $g= $graphs{$section,$group,$elem}; die unless $g; - my $width= num_param('w',370,100,1600); - my $height= num_param('h',200,100,1600); + my $width= num_param('w',$defwidth,100,1600); + my $height= num_param('h',$defheight,100,1600); my $sloth= param('sloth'); die unless defined $sloth; @@ -489,7 +492,7 @@ if (defined $detail) { my $imgurl= "$self?graph=$detail§ion=$section". "&sloth=$tsloth&elem=$elem"; print a({href=>"$imgurl&w=780&h=800"}, - img({src=>$imgurl, alt=>''})); + img({src=>$imgurl, alt=>'', width=>780, height=>800})); } } print end_html(); @@ -535,7 +538,7 @@ foreach my $group (@{ $section_groups{$section} }) { foreach my $elem (@$elems) { my $g= $graphs{$ref_section,$ref_group,$elem}; print img({src=>"$imgurl&elem=$elem&sloth=".($sloth + $g->{Slower}), - alt=>''}); + alt=>'', width=>$defwidth, height=>$defheight}); } print ""; print "\n";