summaryrefslogtreecommitdiffstats
path: root/reports.cgi
diff options
context:
space:
mode:
authordonm%bluemartini.com <>2000-04-26 06:05:32 +0200
committerdonm%bluemartini.com <>2000-04-26 06:05:32 +0200
commite057014bdfe4e7441f44da458eabec52b13c7b22 (patch)
treea005c4cbe4f584f747585286e912cc8c484ee6b8 /reports.cgi
parentf245fda688b12b41440d6e3a0b2a87702d0be4ff (diff)
downloadbugzilla-e057014bdfe4e7441f44da458eabec52b13c7b22.tar.gz
bugzilla-e057014bdfe4e7441f44da458eabec52b13c7b22.tar.xz
patch from bug 2178 applied and fix for versions of GD/Chart::Lines that won't
produce gifs.
Diffstat (limited to 'reports.cgi')
-rwxr-xr-xreports.cgi13
1 files changed, 10 insertions, 3 deletions
diff --git a/reports.cgi b/reports.cgi
index 6b2d8cb1b..be21d0d6c 100755
--- a/reports.cgi
+++ b/reports.cgi
@@ -28,6 +28,7 @@
use diagnostics;
use strict;
+use GD;
eval "use Chart::Lines";
require "CGI.pl";
@@ -438,8 +439,14 @@ FIN
$prodname =~ s/\//-/gs;
+ my $testimg = Chart::Lines->new(2,2);
+ my $x = '$testimg->gif()';
+ eval $x;
+ my $type = ($@ =~ /Can't locate object method/) ? "png" : "gif";
+
my $file = join '/', $dir, $prodname;
- my $image = "$file.gif";
+ my $image = "$file.$type";
+ my $url_image = $dir . "/" . url_quote($prodname) . ".$type";
if (! open FILE, $file)
{
@@ -495,11 +502,11 @@ FIN
$img->set (%settings);
open IMAGE, ">$image" or die "$image: $!";
- $img->gif (*IMAGE, \@data);
+ $img->$type (*IMAGE, \@data);
close IMAGE;
print <<FIN;
-<img src="$image">
+<img src="$url_image">
<br clear=left>
<br>
FIN