File::Properties::Media - Perl module representing properties of a media file
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";
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.
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.
my $fpm = File::Properties::Media->new($path, $fpc);
Constructs a new File::Properties::Media object.
print "Media mime type: " . $fpm->mmimetype . "\n";
Determine the media mime type of the represented file.
print "Media file type: " . $fpm->mfiletype . "\n";
Determine the media file type of the represented file.
print "Media type: " . $fpm->mediatype . "\n";
Determine the media type (the initial part of mime type, e.g. 'image') of the represented file.
print "Modification date: " . $fpm->datemod . "\n";
Determine the EXIF modification date.
my $exh = $fpm->exifhash;
Return a hash mapping EXIF tags names to their values.
print "Is a media file\n" if ($fpm->ismedia);
Determine whether the file is a media file.
print $fpm->string . "\n";
Construct a string representing the object data.
$fpm->_cacheinit($fpc, $options_hash);
Initialise the regular file properties cache table in the cache referred to by the File::Properties::Cache reference argument.
File::Properties, File::Properties::Cache, File::Properties::Compressed, Image::ExifTool
Brendt Wohlberg <wohl@cpan.org>
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.
To install File::Properties, copy and paste the appropriate command in to your terminal.
cpanm
cpanm File::Properties
CPAN shell
perl -MCPAN -e shell install File::Properties
For more information on module installation, please visit the detailed CPAN module installation guide.