Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the documentation #1

Merged
merged 2 commits into from
Jan 22, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 20 additions & 17 deletions lib/Data/Validate/Image.pm
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,6 @@ sub _convert_installed{

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

=head1 IMPORTANT

B<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.

=head1 SYNOPSIS

use Data::Validate::Image;
Expand All @@ -92,25 +86,34 @@ I used convert over PerlMagick because I found PerlMagick to be very unstable.

=head1 DESCRIPTION

pretty simple image validator class. returns hash of image properties on success,
A simple image validator class, which provides a single C<validate> method
that upon success returns a hash ref of image properties:

{
'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 ImageMagick
'animated' => 1 || 0, # requires convert from ImageMagick
}

For invalid images the C<validate> method returns C<undef>.

undef for invalid images
=head2 IMPORTANT

hash properties are
B<REQUIRES> convert (from L<ImageMagick|http://www.imagemagick.org/>) to
detect the C<frames> and C<animated> properties.

'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
I used convert over PerlMagick because I found PerlMagick to be very
unstable.

=head1 METHODS

=head2 validate

returns image info or undef for invalid image
Returns image properties for valid image or C<undef> for invalid image

=head1 AUTHORS

Expand Down