GIFgraph
view release on metacpan or search on metacpan
GIFgraph.pm view on Meta::CPAN
for a graph.
GIFgraph is nothing more than a wrapper around GD::Graph, and its use is
deprecated. It only exists for backward compatibility. The documentation
for all the functionality can be found in L<GD::Graph>.
This module should work with all versions of GD, but it has only been
tested with version 1.19 and above. Version 1.19 is the last version
that produces GIF output directly. Any version later than that requires
a conversion step. The default distribution of GIFgraph uses
Image::Magick for this. If you'd like to use something else, please
replace the sub png2gif in GIFgraph::Convert with something more to your
liking.
=head1 NOTES
Note that if you use GIFgraph with a GD version 1.20 or up that any
included logos will have to be in the PNG format. The only time that GIF
comes into play is _after_ GD has done its work, and the PNG gets
converted to GIF. There are no plans to change that behaviour; it's too
much work, and for you, the user, it is a one time conversion of these
GIFgraph/Convert.pm view on Meta::CPAN
use Carp;
# Change this sub if you want to use something else to convert from PNG
# to GIF.
sub png2gif
{
my $png = shift;
checkImageMagick();
my $im = Image::Magick->new(magick => 'png') or
croak 'Cannot create Image::Magick object';
my $rc = $im->BlobToImage($png);
carp $rc if $rc;
$rc = $im->Set(magick => 'gif');
return $im->ImageToBlob();
}
sub checkImageMagick
{
eval "require Image::Magick";
croak <<EOMSG if $@;
Image::Magick cannot be found. Your version of GD exports PNG format
graphics, and GIFgraph needs something to convert those to GIF. If
you want to provide an alternative method, please edit the sub
png2gif in the file GIFgraph/Convert.pm, and if you're installing,
Makefile.PL.
EOMSG
}
1;
Makefile.PL view on Meta::CPAN
'SUFFIX' => 'gz',
},
'clean' => { 'FILES' => q(*% *.b[ac]k *.old tags) },
);
# GD has already been 'required' by the WriteMakeFile call, but it
# doesn't hurt to do it again.
require GD;
# REMOVE THE FOLLOWING CHECKS IF YOU DON'T USE Image::Magick AND YOU
# HAVE EDITED GIFgraph::Convert.
if (GD::Image->can('png'))
{
print "Checking for conversion of PNG to GIF\n";
require GIFgraph::Convert;
GIFgraph::Convert::checkImageMagick();
}
print <<END;
INSTALLATION
needed to install (also see TESTED PLATFORMS):
perl 5.005 (5.004 might work)
GD > 1.18
GD::Graph
GDTextUtils (for GD::Graph)
Image::Magick, or edit GIFgraph/Convert.pm And Makefile.PL
to install:
perl Makefile.PL
make
make install
IMPORTANT CHANGE SINCE VERSION 1.10
GIFgraph no longer contains any of the code to generate charts. Instead
directly anymore. Dropping support for GIFgraph alltogether was not
really an option, and having a module called GIFgraph that produces PNG
was a bit silly. So I decided to create GD::Graph, and recommend the use
of that directly, and make GIFgraph a wrapper around that, its only
function being to provide a backward compatible interface to GD.
GD VERSIONS
If you want to use a GD version 1.20 or up, you will need to have
something installed that can do an on-the-fly conversion of PNG to GIF.
I recommend that you use Image::Magick, since that is what the GIFgraph
module has been setup to use. If you don't want to, or can't install
Image::Magick, you will have to edit the file GIFgraph/Convert.pm to
provide a different sub png2gif.
AUTHOR
Martien Verbruggen
mgjv@comdyn.com.au
COPYRIGHT
Copyright (c) 1995-2000 Martien Verbruggen. All rights reserved.
( run in 0.376 second using v1.01-cache-2.11-cpan-beeb90c9504 )