File::Headerinfo::Image - an extractor of useful information from image files.


File-Headerinfo documentation Contained in the File-Headerinfo distribution.

Index


Code Index:

NAME

Top

File::Headerinfo::Image - an extractor of useful information from image files.

DESCRIPTION

Top

File::Headerinfo::Image is a thin (going on invisible) wrapper around Image::Size, which is able to retrieve dimensions from most types of image file.

COPYRIGHT

Top

SEE ALSO

Top

Delivery, Delivery::Clip, Delivery::Clip::File, Delivery::Clip::File::Reader


File-Headerinfo documentation Contained in the File-Headerinfo distribution.
package File::Headerinfo::Image;

use strict;
use base qw(File::Headerinfo);
use Image::Size;

sub parse_file {
	my $self = shift;
    my ($w, $h, $type) = Image::Size::imgsize( $self->path );
    return unless $w;
    $self->filetype(lc($type));
    $self->width($w);
    $self->height($h);
}

1;