From c4e99b1bca134290bd4a304b896a3ffc15f404c4 Mon Sep 17 00:00:00 2001 From: "donm%bluemartini.com" Date: Tue, 25 Apr 2000 21:05:32 +0000 Subject: [PATCH] patch from bug 2178 applied and fix for versions of GD/Chart::Lines that won't produce gifs. --- webtools/bugzilla/reports.cgi | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/webtools/bugzilla/reports.cgi b/webtools/bugzilla/reports.cgi index 6b2d8cb1bccc..be21d0d6c319 100755 --- a/webtools/bugzilla/reports.cgi +++ b/webtools/bugzilla/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