NAME

Data::Validate::Image - Validates an image and returns basic info

IMPORTANT

REQUIRES convert (from imagemagick) to be installed and in the path for animated gif/frame detection

I used convert over PerlMagick because I found PerlMagick to be very unstable.

SYNOPSIS

use Data::Validate::Image;

my $validator = Data::Validate::Image->new();
my $image_info = $validator->validate( '/path/to/image' );

if ( defined( $image_info ) ){
    #valid image, do things here
} else {
    #invalid image
}

DESCRIPTION

pretty simple image validator class. returns hash of image properties on success,

undef for invalid images

hash properties are

'width' => image width,
'height' => image height,
'size' => image filesize (KB),
'mime' => image mime type,
'file_ext' => *correct* file extenstion,
'frames' => frame count, #requires convert from imagemagic to be installed
'animated' => 1 || 0, #requires convert from imagemagic to be installed

METHODS

validate

returns image info or undef for invalid image

AUTHORS

Mark Ellis <markellis@cpan.org>

SEE ALSO

Image::Info

LICENSE

Copyright 2014 Mark Ellis <markellis@cpan.org>

This library is free software, you can redistribute it and/or modify it under the same terms as Perl itself.