view release on metacpan or search on metacpan
- Update distro files.
1.66 Sun Jun 8 17:03:24 2008
- Fix for RT#35115.
1.65 Wed Feb 27 21:47:38 2008
- Fix for RT#33629.
- All files unixified (LF).
1.64 Wed Apr 25 21:01:49 2007
- Yet another test suite update for Image::Magick.
- New style "blank" added for evil purposes.
- Fixed a regex in demo.pl
1.63 Sat Feb 24 16:41:03 2007
- I didn't check the existence of Image::Magick in
06-version_magick.t and this resulted with FAILs.
Fixed this and updated all magick tests. They now
show the real number of skipped tests (if they are skipped)
1.62 Fri Feb 23 23:13:37 2007
- Minor fixes in Pods. Added an image samples section
(as HTML) and CPAN modules that are using GD::SecurityImage.
Also added a SUPPORT section.
- Updated demo.pl. Added "program" config option.
- Refactored and cleaned up some parts and demo.
1.54 Fri Apr 8 23:11:32 2005
- Updated pods.
- If anyone adds a back-end, one must define a method
to deal with colors: 'backend_cconvert'. cconvert()
will forward all calls to backend_cconvert() if
$BACKEND is different than /^(GD|Magick)$/. Note that
this method must be capable of handling both HEX and RGB.
- Finally documented this. See BACKEND_AUTHORS section in
the pod (If you have a HTML version, probably you can not
see this).
- Removed gdbox_empty from GD::SecurityImage::Magick
- The module now has an AUTOLOAD method.
- Added a check for gdbox_empty in AUTOLOAD for non-GD
backends.
- Ooops! ellipse() added in GD 2.07 :p Thanks to ActiveState
build logs. I missed that one (looks like all CPAN Testers
are using recent GDs).
Added a global mechanism to check this and any incompatibilities.
If GD < 2.07 and you call ellipse() it will fall-back to default()
style. If you call ec() style, it'll disable ellipse() call and only
draw circles.
have gif() method but don't have gif support enabled. This results
with an empty image. Cause: old libgd).
- Default image type in GD::SecurityImage::GD::out() changed to 'png'.
1.53 Wed Jan 5 18:21:59 2005
- Added a new option 'backend' to import(). With this
option you can now include other back-ends:
use GD::SecurityImage backend - 'Magick';
will load the GD::SecurityImage::Magick for example.
If you wrote a backend for GD::SecurityImage, you can
now combine your back-end with GD::SecurityImage. Like,
if you created a Imager back-end named 'GD::SecurityImage::Imager',
you can load it like this:
use GD::SecurityImage backend - 'Imager';
No one requested this kind of functionality (yet), but I'm
adding it anyway. And *NO* I will not create an Imager or
any other backend myself (at least not in the near future).
I' m already supporting two different interfaces.
Probably cconvert() also needs a fix to support such a thing.
I'll deal with that later.
- If you have loaded Image::Magick outside and then you call
GD::SecurityImage with the GD backend (or simply use it)
your code dies with a weird error. Since it setups the
interface for Image::Magick, but you didn't select Image::Magick
as the backend. For example, this simple code dies if you are using
1.52 and below:
use Image::Magick;
use GD::SecurityImage;
GD::SecurityImage->new->create;
This bug cought by Dave Rolsky.
- New class variable $BACKEND added to deal with this bug.
The backend is now completely checked and set in import().
- Also, the module is now checking whether you called import()
or not. If you didn't, it'll die (it actually checks if $BACKEND
has a value).
- Added a new test 'backend.t' to check these.
1.52 Tue Dec 21 15:07:37 2004
- After implementing HEX colors with cconvert, I forgot to
set default colors in create() which will throw an exception
without the default color values.
Reported by Billy Vierra.
- Updated pod.
1.51 Sun Dec 19 00:02:13 2004
- Updated demo program code.
- Updated Makefile.PL.
- New private method cconvert for transparent GD/Image::Magick
color conversion.
- Removed GD::SecurityImage::Magick::rgbx().
- The module now supports hex color codes like "#ffffff".
- Updated pod.
- [NOT DOCUMENTED] New private method add_strip.
- [NOT DOCUMENTED] New method set_tl.
- [NOT DOCUMENTED] New method change_random.
- [NOT DOCUMENTED] New parameter 'text_location' added to new.
- [NOT DOCUMENTED] With text_location option, you can now add info boxes to
the 4 corners of the image (or you can use this for something else).
- [NOT DOCUMENTED] Behavior of out() changed. If set_tl is used and
1.4_02 Sat Oct 9 14:48:18 2004
- Fixed a bug in new for the angle parameter.
- New private method setThickness.
- New option 'thickness' added to new.
- Replaced buggy/silly "_charw" with "ttf_info" in GD backend.
Hopefully, this fixes the "scramble" implementation for GD.
- Updated test suite. Now, there is a single test api and two
test files.
- Changed Makefile.PL. "GD" is now hardcoded as a prerequisite.
Removed user input codes. The presence of "Image::Magick"
is now tested inside the test file and magick test will
be skipped if there is no "Image::Magick"
(request from Barbie -- not exactly this, but similar).
1.4_01 Mon Sep 20 16:46:13 2004
- It looks like newer versions of GD does not have the path
bug, but I do not know the exact version that this was
fixed. Anyway, it looks like v2.16 does not have that bug.
Also added this to Pod.
- The module now automatically drops to 'normal' mode if
you are using GD and your GD version is smaller than 1.20
and you have selected 'ttf' method.
anything about it.
GD wants an *exact* path with no spaces in it for TTF Fonts.
Just don't put your codes/fonts in paths that have spaces in it.
And don't try to "make test" from a location like this.
You can blame windowz and/or libgd for this.
Also, if Cwd::getcwd() can not get the exact path, we will have
the same problem, but after this version, you'll probably not
get "Use of uninitialized value" warnings.
- New method gdbox_empty() added to GD::SecurityImage::GD.
Also added a fake gdbox_empty() method to
GD::SecurityImage::Magick for compatibility.
Under GD::SecurityImage::Magick, this method always returns
false.
- Minor fix in create().
- Updated Pods. Sub modules have definiton of what they are now.
1.321 Wed Jul 28 21:52:04 2004
- Updated tests. Code didn't change.
1.32 Wed Jul 28 15:49:12 2004
- Minimal fix in create().
- There is a bug in PerlMagicks older than 6.0.4.
From <http://www.imagemagick.org/www/Changelog.html>:
"PerlMagick's QueryFontMetrics() incorrectly reports
`unrecognized attribute'` for the `font' attribute".
Image::Magick test is now skipped if your
$Image::Magick::VERSION is smaller than 6.0.4.
Please upgrade to 6.0.4, if you want to use Image::Magick
as the backend.
- Added this bug to Pod.
1.31 Sun Jun 27 00:08:49 2004
- Updated Pod.
- send_ctobg is disabled automatically if style is
set to 'box'.
- All styles can put a frame around the image now.
And this feature is enabled by default.
- New option 'frame' added to new().
- Renamed constants in GD::SecurityImage::GD.
- Changed tests.
1.3 Mon Jun 21 19:11:13 2004
- New method particle().
- Private method r2h().
- Fixed color conversion for Image::Magick.
- out() now accepts arguments.
- Updated pod.
1.2 Fri Jun 18 21:39:08 2004
- Added raw() method.
- Fixed gd_font object key.
- new style "ec".
- Adapted Image::Magick compatibility (request from Mark Fuller).
I may add Image::Magick spesific styles in future releases.
- New modules added:
GD::SecurityImage::GD
GD::SecurityImage::Magick
GD::SecurityImage::Styles
and GD::SecurityImage is smaller now ;)
- Renamed old tests to (added 'gd_' to names):
t/gd_01_use.t
t/gd_02_normal.t
t/gd_03_ttf.t
- Added new tests:
t/im_01_use.t
t/im_02_ttf.t
- Altered Makefile.PL and test files to skip tests if the user selects to do so.
"develop" : {
"requires" : {
"Pod::Coverage::TrustPod" : "0",
"Test::CPAN::Meta" : "0",
"Test::Pod" : "1.41",
"Test::Pod::Coverage" : "1.08"
}
},
"runtime" : {
"recommends" : {
"Image::Magick" : "6.66"
},
"requires" : {
"GD" : "2.45",
"perl" : "5.010"
}
},
"test" : {
"recommends" : {
"CPAN::Meta" : "2.120900"
},
keywords:
- gd
- securityimage
- captcha
license: perl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
version: '1.4'
name: GD-SecurityImage
recommends:
Image::Magick: '6.66'
requires:
GD: '2.45'
perl: '5.010'
resources:
bugtracker: https://github.com/burak/CPAN-GD-SecurityImage/issues
repository: git://github.com/burak/CPAN-GD-SecurityImage.git
version: '1.75'
x_contributors:
- 'Burak Gursoy <burak@cpan.org>'
x_serialization_backend: 'YAML::Tiny version 1.69'
exclude_filename = weaver.ini
exclude_match = GD-SecurityImage-[0-9]+
; metadata
[MetaYAML]
[MetaJSON]
[Keywords]
keywords = gd securityimage captcha
; We don't want Image::Magick to be a hard dependency
; [AutoPrereqs]
[Prereqs / Recommended]
-relationship = recommends
Image::Magick = 6.66
[Prereqs]
perl = 5.010
GD = 2.45
[ExecDir]
[ShareDir]
[GitHub::Meta]
use constant MAGICK_PTSIZE => 12;
use constant GD_PTSIZE => 8;
my %config = (
database => 'gdsi', # database name (for session storage)
table_name => 'sessions', # only change this value, if you *really* have to use another table name. Also change the SQL code below.
user => 'root', # database user name
pass => q{}, # database user's password
font => getcwd.'/StayPuft.ttf', # ttf font. change this to an absolute path if getcwd is failing
itype => 'png', # image format. set this to gif or png or jpeg
use_magick => 0, # use Image::Magick or GD
img_stat => 1, # display statistics on the image?
program => q{}, # if CGI.pm fails to locate program url, set this value.
);
# You'll need this to create the sessions table.
# CREATE TABLE sessions ( id char(32) not null primary key, a_session text )
# - - - - - - - - - - - - > S T A R T P R O G R A M < - - - - - - - - - - - #
our $VERSION = '1.51';
return $pass ? $self->_congrats( $code, $ses )
: $self->_failure( $code, $ses )
;
}
sub backenduri {
my $self = shift;
my $rv = q{Security image generated with <b>};
$rv .= $self->{IS_GD}
? qq~<a href="$self->{CPAN}/GD" target="_blank">GD</a> v$GD::VERSION~
: qq~<a href="$self->{CPAN}/PerlMagick" target="_blank">Image::Magick</a> v$Image::Magick::VERSION~;
return $rv . '</b>';
}
sub _random { return String::Random->new->randregex('\d\d\d\d\d\d') }
sub _failure {
my $self = shift;
my $code = CGI::escapeHTML(shift || q{});
my $ses = shift || q{};
my $rv = <<"FAIL";
<tr>
<td> itype </td>
<td><i>gif</i></td>
<td>Image format. You can set this to <i>png</i>
or <i>gif</i> or <i>jpeg</i>.</td>
</tr>
<tr>
<td> use_magick </td>
<td><i>FALSE</i></td>
<td>False value: <b>GD</b> will be used; True value: <b>Image::Magick</b>
will be used.</b>
</td>
</tr>
<tr>
<td> img_stat </td>
<td><i>TRUE</i></td>
<td>If has a true value, some statistics like "image generation"
and "total execution" times will be placed on the image.
The page you see this also shows that information,
=head1 DESCRIPTION
This program demonstrates the abilities of C<GD::SecurityImage>.
It needs these CPAN modules:
DBI
DBD::mysql
Apache::Session::MySQL
String::Random
GD::SecurityImage (with GD or Image::Magick)
and these CORE modules:
CGI
Cwd
Time::HiRes
Also, be sure to use recent versions of GD. This demo needs at least
version C<1.31> of GD. And if you want to use C<Image::Magick> it must
be C<6.0.4> or newer.
You'll also need a MySQL server to run the program. You must create
a table with this SQL code:
CREATE TABLE sessions (
id char(32) not null primary key,
a_session text
);
lib/GD/SecurityImage.pm view on Meta::CPAN
use constant MAX_RGB_PARAMS => 3;
sub import {
my($class, @args) = @_;
my %opt = @args % 2 ? () : @args;
# init/reset globals
$BACKEND = q{}; # name of the back-end
@ISA = (); ## no critic (ClassHierarchies::ProhibitExplicitISA)
# load the drawing interface
if ( exists $opt{use_magick} && $opt{use_magick} ) {
require GD::SecurityImage::Magick;
$BACKEND = 'Magick';
}
elsif ( exists $opt{backend} && $opt{backend} ) {
my $be = __PACKAGE__.q{::}.$opt{backend};
my $eok = eval "require $be";
croak "Unable to locate the $class back-end $be: $@" if $@;
$BACKEND = $opt{backend} eq 'AC' ? 'GD' : $opt{backend};
}
else {
require GD::SecurityImage::GD;
lib/GD/SecurityImage.pm view on Meta::CPAN
sub new {
my($class, @args) = @_;
$BACKEND || croak "You didn't import $class!";
my %opt = @args % 2 ? () : @args;
my $self = {
IS_MAGICK => $BACKEND eq 'Magick',
IS_GD => $BACKEND eq 'GD',
IS_CORE => $BACKEND eq 'GD' || $BACKEND eq 'Magick',
DISABLED => {}, # list of methods that a backend (or some older version of backend) can't do
MAGICK => {}, # Image::Magick configuration options
GDBOX_EMPTY => 0, # GD::SecurityImage::GD::insert_text() failed?
_RANDOM_NUMBER_ => q{}, # random security code
_RNDMAX_ => 6, # maximum number of characters in a random string.
_COLOR_ => {}, # text and line colors
_CREATECALLED_ => 0, # create() called? (check for particle())
_TEXT_LOCATION_ => {}, # see info_text
};
bless $self, $class;
my %options = $self->_new_options( %opt );
lib/GD/SecurityImage.pm view on Meta::CPAN
my $lk = scalar @keys;
my $random;
$random .= $keys[int rand $lk] for 1..$self->{rndmax};
$self->{_RANDOM_NUMBER_} = $random;
}
return defined wantarray ? $self : undef;
}
sub cconvert { # convert color codes
# GD : return color index number
# Image::Magick: return hex color code
my $self = shift;
my $data = shift || croak 'Empty parameter passed to cconvert';
return $self->backend_cconvert($data) if not $self->{IS_CORE};
my $is_hex = $self->is_hex($data);
my $magick_ok = $self->{IS_MAGICK} && $data && $is_hex;
# data is a hex color code and Image::Magick has hex support
return $data if $magick_ok;
my $color_code = $data &&
! $is_hex &&
! ref($data) &&
$data !~ m{[^0-9]}xms &&
$data >= 0;
if( $color_code ) {
if ( $self->{IS_MAGICK} ) {
croak "The number '$data' can not be transformed to a color code!";
lib/GD/SecurityImage.pm view on Meta::CPAN
or you can just say (most of the public methods can be chained)
my($image, $type, $rnd) = GD::SecurityImage->new->random->create->particle->out;
to create a security image with the default settings. But that may not
be useful. If you C<require> the module, you B<must> import it:
require GD::SecurityImage;
GD::SecurityImage->import;
The module also supports C<Image::Magick>, but the default interface
uses the C<GD> module. To enable C<Image::Magick> support, you must
call the module with the C<use_magick> option:
use GD::SecurityImage use_magick => 1;
If you C<require> the module, you B<must> import it:
require GD::SecurityImage;
GD::SecurityImage->import(use_magick => 1);
The module does not I<export> anything actually. But C<import> loads
lib/GD/SecurityImage.pm view on Meta::CPAN
$color = '#80C0F0'; # HEX
$color2 = [15, 100, 75]; # RGB
$i->create($meth, $style, $color, $color2)
$i->create(ttf => 'box', '#80C0F0', '#0F644B')
RGB values must be passed as an array reference including the three
I<B<R>ed>, I<B<G>reen> and I<B<B>lue> values.
Color conversion is transparent to the user. You can use hex values
under both C<GD> and C<Image::Magick>. They' ll be automagically
converted to RGB if you are under C<GD>.
=head1 METHODS
=head2 new
The constructor. C<new()> method takes several arguments. These
arguments are listed below.
=over 4
lib/GD/SecurityImage.pm view on Meta::CPAN
either C<up> or C<down>.
=item strip
If has a true value, a strip will be added to the background of the
information text.
=item gd
This option can only be used under C<GD>. Has no effect under
Image::Magick. If has a true value, the standard GD font C<Tiny>
will be used for the information text.
If this option is not present or has a false value, the TTF font
parameter passed to C<new> will be used instead.
=item ptsize
The ptsize value of the information text to be used with the TTF font.
TTF font parameter can not be set with C<info_text()>. The value passed
to C<new()> will be used instead.
lib/GD/SecurityImage.pm view on Meta::CPAN
long texts, be sure to adjust the image, or clipping will occur.
=back
=head2 out
This method finally returns the created image, the mime type of the
image and the random number(s) generated.
The returned mime type is C<png> or C<gif> or C<jpeg> for C<GD> and
C<gif> for C<Image::Magick> (if you do not C<force> some other format).
C<out> method accepts arguments:
@data = $image->out(%args);
=over 4
=item force
You can set the output format with the C<force> parameter:
@data = $image->out(force => 'png');
If C<png> is supported by the interface (via C<GD> or C<Image::Magick>);
you'll get a png image, if the interface does not support this format,
C<out()> method will use it's default configuration.
=item compress
And with the C<compress> parameter, you can define the compression
for C<png> and quality for C<jpeg>:
@data = $image->out(force => 'png' , compress => 1);
@data = $image->out(force => 'jpeg', compress => 100);
lib/GD/SecurityImage.pm view on Meta::CPAN
=back
=head2 raw
Depending on your usage of the module; returns the raw C<GD::Image>
object:
my $gd = $image->raw;
print $gd->png;
or the raw C<Image::Magick> object:
my $magick = $image->raw;
$magick->Write("gif:-");
Can be useful, if you want to modify the graphic yourself. If you
want to get an I<image type> see the C<force> option in C<out>.
=head2 gdbox_empty
See L</"path bug"> in L</"GD bug"> for usage and other information
lib/GD/SecurityImage.pm view on Meta::CPAN
rectangle draws a rectangle
filledRectangle draws a filled rectangle
ellipse draws an ellipse
arc draws an arc
setThickness sets the thickness of the lines when drawing something
and
backend_cconvert for HEX & RGB color handling
See GD::SecurityImage::Magick for the first part of methods and see
cconvert() method in GD::SecurityImage to define such a method. Your
backend_cconvert() method must be capable of handling both HEX and RGB
values. The parameters passed to drawing methods (like line()) are
in GD format. See the L<GD> module for examples.
You can then name your distro as 'GD::SecurityImage::X' and anyone can use
it like:
use GD::SecurityImage backend => 'X';
lib/GD/SecurityImage.pm view on Meta::CPAN
libgd and GD.pm don't like relative paths and paths that have spaces
in them. If you pass a font path that is not an B<exact path> or a path that
have a space in it, you may get an empty image.
To check if the module failed to find the ttf font (when using C<GD>), a new
method added: C<gdbox_empty()>. It must be called after C<create()>:
$image->create;
die "Error loading ttf font for GD: $@" if $image->gdbox_empty;
C<gdbox_empty()> always returns false, if you are using C<Image::Magick>.
=head1 COMMON ERRORS
=head2 Wrong GD installation
I got some error reports saying that GD::SecurityImage dies
with this error:
Can't locate object method "new" via package "GD::Image"
(perhaps you forgot to load "GD::Image"?) at ...
lib/GD/SecurityImage.pm view on Meta::CPAN
=back
=head1 CAVEAT EMPTOR
=over 4
=item *
Using the default library C<GD> is a better choice. Since it is faster
and does not use that much memory, while C<Image::Magick> is slower and
uses more memory.
=item *
The internal random code generator is used B<only> for demonstration
purposes for this module. It may not be I<effective>. You must supply
your own random code and use this module to display it.
=back
=head1 SEE ALSO
=head2 Other CAPTCHA Implementations & Perl Modules
=over 4
=item *
L<GD>, L<Image::Magick>
=item *
L<ImagePwd>, L<Authen::Captcha>.
=item *
C<ImageCode> Perl Module (commercial): L<http://www.progland.com/ImageCode.html>.
=item *
lib/GD/SecurityImage/GD.pm view on Meta::CPAN
push @iargs, $opt{'compress'} if $type eq 'jpeg';
}
return $i->$type(@iargs), $type, $self->{_RANDOM_NUMBER_};
}
sub gdbox_empty { return shift->{GDBOX_EMPTY} }
sub gdfx {
# Sets the font for simple GD usage.
# Unfortunately, Image::Magick does not have a similar interface.
my $self = shift;
my $font = shift || return;
$font = lc $font;
# GD' s standard fonts
my %f = map { lc $_ => $_ } GDFONTS;
if ( exists $f{$font} ) {
$font = $f{$font};
return GD::Font->$font();
}
}
lib/GD/SecurityImage/Magick.pm view on Meta::CPAN
package GD::SecurityImage::Magick;
$GD::SecurityImage::Magick::VERSION = '1.75';
# GD method emulation class for Image::Magick
use strict;
use warnings;
# Magick related
use constant XPPEM => 0; # character width
use constant YPPEM => 1; # character height
use constant ASCENDER => 2; # ascender
use constant DESCENDER => 3; # descender
use constant WIDTH => 4; # text width
use constant HEIGHT => 5; # text height
use constant MAXADVANCE => 6; # maximum horizontal advance
# object
use constant ANGLE => -2;
use constant CHAR => -1;
# image data
use constant MAX_COMPRESS => 100;
use constant FULL_CIRCLE => 360;
use Image::Magick;
sub init {
# Create the image object
my $self = shift;
my $bg = $self->cconvert( $self->{bgcolor} );
$self->{image} = Image::Magick->new;
$self->{image}->Set( size=> "$self->{width}x$self->{height}" );
$self->{image}->Read( 'null:' . $bg );
$self->{image}->Set( background => $bg );
$self->{MAGICK} = { strokewidth => 0.6 };
$self->setThickness( $self->{thickness} ) if $self->{thickness};
return;
}
sub out {
my($self, @args) = @_;
lib/GD/SecurityImage/Magick.pm view on Meta::CPAN
if($type eq 'png') {
$opt{'compress'} = MAX_COMPRESS;
$self->{image}->Set( compression => 'Zip' );
}
$self->{image}->Set( quality => $opt{'compress'} );
}
return $self->{image}->ImageToBlob, $type, $self->{_RANDOM_NUMBER_};
}
sub insert_text {
# Draw text using Image::Magick
my $self = shift;
my $method = shift; # not needed with Image::Magick (always use ttf)
my $key = $self->{_RANDOM_NUMBER_}; # random string
my $info = sub {
$self->{image}->QueryFontMetrics(
font => $self->{font},
text => shift,
pointsize => $self->{ptsize},
)
};
my %same = (
font => $self->{font},
lib/GD/SecurityImage/Magick.pm view on Meta::CPAN
1;
__END__
=pod
=encoding UTF-8
=head1 NAME
GD::SecurityImage::Magick
=head1 VERSION
version 1.75
=head1 SYNOPSIS
See L<GD::SecurityImage>.
=head1 DESCRIPTION
Includes GD method emulations for Image::Magick.
Used internally by L<GD::SecurityImage>. Nothing public here.
=head1 NAME
GD::SecurityImage::Magick - Image::Magick backend for GD::SecurityImage.
=head1 METHODS
=head2 arc
=head2 ellipse
=head2 filledRectangle
=head2 init
t/00-report-prereqs.dd view on Meta::CPAN
'develop' => {
'requires' => {
'Pod::Coverage::TrustPod' => '0',
'Test::CPAN::Meta' => '0',
'Test::Pod' => '1.41',
'Test::Pod::Coverage' => '1.08'
}
},
'runtime' => {
'recommends' => {
'Image::Magick' => '6.66'
},
'requires' => {
'GD' => '2.45',
'perl' => '5.010'
}
},
'test' => {
'recommends' => {
'CPAN::Meta' => '2.120900'
},
t/04-backend.t view on Meta::CPAN
ok( $class->new->raw->isa('GD::Image' ), 'Loaded GD [1]' );
$class->import( backend => 'GD' );
ok( $class->new->raw->isa('GD::Image' ), 'Loaded GD [2]' );
}
SKIP: {
if ( $MAGICK_SKIP ) {
skip( $MAGICK_SKIP . ' Skipping...', $total{magick} );
}
$class->import( use_magick => 1 );
ok( $class->new->raw->isa('Image::Magick'), 'Loaded Magick [1]' );
$class->import( backend => 'Magick' );
ok( $class->new->raw->isa('Image::Magick'), 'Loaded Magick [2]' );
}
}
t/magick.pl view on Meta::CPAN
use strict;
use warnings;
use vars qw( $MAGICK_SKIP );
BEGIN {
my $eok = eval {
require Image::Magick;
1;
};
if ( $@ || ! $eok ) {
$MAGICK_SKIP = "You don't have Image::Magick installed. $@";
}
else {
$MAGICK_SKIP = q{};
}
}
1;