NAME
File::Properties::Media - Perl module representing properties of a media file
SYNOPSIS
use File::Properties::Cache;
use File::Properties::Media;
my $fpc = File::Properties::Media->cache('cache.db');
my $fpm = File::Properties::Media->new('/path/to/file', $fpc);
print "Media mime type: " . $fpm->mmimetype . "\n";
ABSTRACT
File::Properties::Media is a Perl module representing properties of
a media file, in addition to the properties stored in
File::Properties::Compressed from which it is derived.
DESCRIPTION
File::Properties::Media is a Perl module representing properties of
a media file, in addition to the properties stored in
File::Properties::Compressed from which it is derived. These media
file properties consist of mime type and file type as extracted by
Image::Exiftool, the media type ('image', 'video', or 'audio'), the
modification date, and a hash representing the full EXIF data. If a
reference to a File::Properties::Cache object is specified in the
constructor, access to the properties is via the cache.
- new
-
my $fpm = File::Properties::Media->new($path, $fpc);
Constructs a new File::Properties::Media object.
- mmimetype
-
print "Media mime type: " . $fpm->mmimetype . "\n";
Determine the media mime type of the represented file.
- mfiletype
-
print "Media file type: " . $fpm->mfiletype . "\n";
Determine the media file type of the represented file.
- mediatype
-
print "Media type: " . $fpm->mediatype . "\n";
Determine the media type (the initial part of mime type, e.g. 'image') of the represented file.
- datemod
-
print "Modification date: " . $fpm->datemod . "\n";
Determine the EXIF modification date.
- exifhash
-
my $exh = $fpm->exifhash;
Return a hash mapping EXIF tags names to their values.
- ismedia
-
print "Is a media file\n" if ($fpm->ismedia);
Determine whether the file is a media file.
- string
-
print $fpm->string . "\n";
Construct a string representing the object data.
- _cacheinit
-
$fpm->_cacheinit($fpc, $options_hash);
Initialise the regular file properties cache table in the cache referred to by the File::Properties::Cache reference argument.
SEE ALSO
File::Properties, File::Properties::Cache, File::Properties::Compressed, Image::ExifTool
AUTHOR
Brendt Wohlberg <wohl@cpan.org>
COPYRIGHT AND LICENSE
Copyright (C) 2010,2011 by Brendt Wohlberg
This library is available under the terms of the GNU General Public License (GPL), described in the LICENSE file included in this distribution.