[Rt-commit] r5132 - in rt/branches/3.5-TESTING: .
jesse at bestpractical.com
jesse at bestpractical.com
Fri Apr 28 12:28:49 EDT 2006
Author: jesse
Date: Fri Apr 28 12:28:48 2006
New Revision: 5132
Modified:
rt/branches/3.5-TESTING/ (props changed)
rt/branches/3.5-TESTING/html/Search/Chart
Log:
r12019 at hualien: jesse | 2006-04-28 12:27:03 -0400
* If the system GD library can't display PNGs, display GIFs
Modified: rt/branches/3.5-TESTING/html/Search/Chart
==============================================================================
--- rt/branches/3.5-TESTING/html/Search/Chart (original)
+++ rt/branches/3.5-TESTING/html/Search/Chart Fri Apr 28 12:28:48 2006
@@ -76,7 +76,15 @@
}
my $plot = $chart->plot( [ [@keys], [@values] ] ) or die $chart->error;
- $r->content_type('image/png');
- $m->out( $plot->png );
+ if ($plot->can('png') ) {
+ $r->content_type('image/png');
+ $m->out( $plot->png );
+ } elsif ($plot->can('gif')) {
+ $r->content_type('image/gif');
+ $m->out( $plot->gif );
+
+ } else {
+ die "Your GD library appears to support neither PNG nor GIF";
+ }
$m->abort();
</%init>
More information about the Rt-commit
mailing list