Test-VariousBits
view release on metacpan or search on metacpan
devel/gd.pl view on Meta::CPAN
exit 0;
}
{
Test::Without::GD->without_png;
Test::Without::GD->without_jpeg;
#Test::Without::GD->without_gif;
GD::Image->newFromGif('/usr/share/xulrunner-1.9.1/res/arrow.gif');
GD::Image->newFromJpeg('/usr/share/doc/imagemagick/images/background.jpg');
GD::Image->newFromPng('/usr/share/xemacs-21.4.22/etc/cbx.png');
GD::Image->newFromPngData('');
exit 0;
}
lib/Test/Without/GD.pm view on Meta::CPAN
_without_func('GD::Image::_newFromJpeg');
_without_func('GD::Image::newFromJpegData');
_without_func('GD::Image::jpeg');
if (my $coderef = GD::Image->can('jpeg')) {
die "Oops, GD::Image->can('jpeg') still true: $coderef";
}
}
#------------------------------------------------------------------------------
sub without_png {
_without_func('GD::Image::_newFromPng');
_without_func('GD::Image::newFromPngData');
_without_func('GD::Image::png');
if (my $coderef = GD::Image->can('png')) {
die "Oops, GD::Image->can('png') still true: $coderef";
}
}
#------------------------------------------------------------------------------
sub without_gif {
_without_func('GD::Image::_newFromGif');
_without_func('GD::Image::newFromGifData');
lib/Test/Without/GD.pm view on Meta::CPAN
=item C<Test::Without::GD-E<gt>without_png()>
=item C<Test::Without::GD-E<gt>without_jpeg()>
=item C<Test::Without::GD-E<gt>without_gif()>
Pretend that PNG, JPEG or GIF format is not available. This means removing
the respective C<GD::Image> methods,
_newFromPng() newFromPngData() png()
_newFromJpeg() newFromJpegData() jpeg()
_newFromGif() newFromGifData() gif()
as is the case when GD is built without C<HAVE_PNG>, C<HAVE_JPEG> or
C<HAVE_GIF>.
The documented entrypoints C<newFromPng()>, C<newFromJpeg()> and
C<newFromGif()> in fact remain, but their underlying C<_newFromPng()> etc
are removed causing them to die.
=item C<Test::Without::GD-E<gt>without_gifanim()>
Pretend that animated GIF support is not available. This means replacing
C<GD::Image> methods
gifanimbegin(), gifanimadd(), gifanimend()
with instead
( run in 0.797 second using v1.01-cache-2.11-cpan-0a6323c29d9 )