NAME

Image::DB::File - OO Representation of an image File object


SYNOPSIS

use Image::DB::File;

my $image = new Image::DB::File($filename);


SYNOPSIS

$imageObject->getBackend()->getId(); $imageObject->getAbsoluteFilename(); $imageObject->getFilename(); $imageObject->getProperties()->{file_media_type}; $imageObject->setPlace(``Rostock''); $imageObject->getDate(); $imageObject->setDescription(``My new description'');

my $clonedImageObject = Image::DB::File->new($imageObject, ``BackendType'');


DESCRIPTION

This class describes an image file. It searches for image database backends to retrieve it's information (see the Image::DB::Backend manpage for information). Furthermore it uses Image::Info to get meta information about a file and creates an Object representation of the gathered information.

new(FILENAME)
new(FILENAME, BACKEND)
    Create a new L<Image::DB::File> object from the filename
    If no BACKEND is specified as second argument, then the 
    first backend that provides information about the image
    file is used implicitly. Otherwise (if the BACKEND was
    specified as argument) this backend is used even if it 
    does not provide information about the image file.
new(FILEOBJ, BACKEND)
    Create a new L<Image::DB::File> object from the 
    The backend that is specified as second argument is used even if it 
    does not provide information about the image file. This is a cloning
    constructor.
    
    The specified backend must differ from the backend of the FILEOBJ;
    otherwise an exception is thrown.
setBackend(IMAGE_DB_BACKEND_OBJECT), getBackend()
        Sets or returns the storage backend (as Image::DB::Backend object)
setDescription(STRING), getDescription()
        Sets or returns the image description
setFilename(FILENAME), getFilename()
        Sets or returns the filename (without path)
setFoldername(FOLDERNAME), getFoldername()
        Sets or returns the path part of the filename (without filename)
getDisplayname()
        Returns a trimmed presentation of the AbsoluteFilename. If the filename is too long, then
    only the leading and trailing part of the name is returned.
setKeywords(A,COMMA,SEPARATED,LIST,OF,STRINGS), getKeywords()
        Sets or returns the list of keywords
setDate(SECONDS_SINCE_EPOCH), getDate()
        Sets or returns the date in seconds since epoch. If a string representation of the date
    is known, then the function str2time() from the Date::Parse module can be used to calculate
    the time value.
setPlace(STRING), getPlace()
        Sets or returns the place, where the image was taken
getAbsoluteFilename()
        Returns the absolute file name (a string concaternation of getFoldername() and getFilename()).
getProperties()
        Returns an Image::Info data structure with meta information of the image file.
asXML()
    Returns the meta information of the object as XML structure.
<Image backend='GThumb' mimetype='image/png'>   <Folder>/home/drue/Projects/image-db/t/images/gthumb</Folder>   <Filename>demo2.png</Filename>   <Description></Description>   <Keywords></Keywords>   <Place></Place>   <Date>07/25/04 00:21:53</Date> </Image>
toString()
        Returns a string representation of the file object.  This method is
        used for string interpolarization, e.g. C<print "This is $imageobject\n";>.


SEE ALSO

the Image::Info manpage, the Image::DB::Backend manpage


AUTHOR

Dirk Ruediger, <drue@an-der-warnow.de>


COPYRIGHT AND LICENSE

Copyright (C) 2004 by Dirk Ruediger

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.3 or, at your option, any later version of Perl 5 you may have available.

   =cut