server->server_admin;
$r->send_http_header("text/html");
$r->print(<<"EOF");
Error:
$message
The Request was:
@{[ $r->the_request ]}
Please contact the server administrator, $contact and
inform them of the time the error occured, and anything you might have done to
cause the error.
EOF
$r->log_error (__PACKAGE__.': '.$r->the_request.': '.$message);
}
# findFont ($basename)
#
# Searches the true type font path for a file, returns the first match.
#
# Returns undef if no font was found.
sub findFont ($) {
my $name = shift || return undef;
# Don't need to search for qualified file names or font objects.
return $name
if ($name =~ m!^/!) || (ref $name);
my @path = map { m!(.*?)/*$! } split /:/, GD::Text->font_path;
for my $path (@path) {
for my $font (<$path/*>) {
return $font if $font =~ m!/$name$!i;
}
}
}
# resolveColor ($gd_graph_object, $color_name)
#
# Resolve a GD::Graph::colour builtin into the index for GD, if it's not
# numeric already.
#
sub resolveColor ($$) {
my ($graph, $color) = @_;
return $color if $color !~ /[A-z]/;
return $graph->set_clr (GD::Graph::colour::_rgb($color));
}
1;
__END__
=head1 AUTHOR
Rafael Kitover (caelum@debian.org)
=head1 COPYRIGHT
This program is Copyright (c) 2000,2001 by Rafael Kitover. This program is free
software; you can redistribute it and/or modify it under the same terms as Perl
itself.
=head1 ACKNOWLEDGEMENTS
This module owes its existance, obviously, to the availability of the wonderful
GD::Graph module from Martien Verbruggen .
Thanks to my employer, Gradience, Inc., for allowing me to work on projects
as free software.
Thanks to Vivek Khera, Scott Holdren and Drew Negentesh for the bug fixes.
=head1 BUGS
Probably a few.
We should probably just let people set up their own PerlFixupHandlers for
errors, but this makes it more difficult to set up. At least, it should be an
option.
=head1 TODO
Variable mapping of x-labels to data points.
Better test suite.
=head1 SEE ALSO
L,
L,
L,
L
=cut