NAME
Labyrinth::Media - Media files handler for Labyrinth
DESCRIPTION
This module collates many media and image file handling functionality used within Labyrinth.
It should be noted that internally images and media files are stored in the same, although images also record dimensions. When retrieving the required files, it is recommend you call the appropriate method to ensure you are getting the correct format of data for the file format. For example, GetImage and GetMedia, both return file information, but GetImage adds deminsion data.
Also note that Images and Photos differ in the directory structure storage, so saving and copying need to reference different functions. See below for a more detailed explanation.
PUBLIC INTERFACE FUNCTIONS
Stock Control Functions
- CGIFile
- StockName
- StockPath
- StockSelect
- StockType
- PathMove
Image Functions
- GetImage($imageid)
-
Retrieves the image data for a given imageid.
- SaveImageFile(%hash)
-
Saves an uploaded image file into the specified directory structure. If not save directory is specified, the draft folder is used. The hash can contain the following:
param - the CGI parameter used to reference the upload file width - maximum saved width (default = 120px) height - maximum saved height (default = 120px) imageid - if overwriting already existing file stock - file category (used to define the save directory)
- MirrorImageFile
Image Functions
Media Functions
- GetMedia($imageid)
-
Retrieves the media data for a given imageid.
- SaveMediaFile(%hash)
-
Saves an uploaded media file into the specified directory structure. If no save directory is specified, the draft folder is used. The hash can contain the following:
param - the CGI parameter used to reference the upload file imageid - if overwriting already existing file stock - file category (used to define the save directory)
- SaveFile(%hash)
-
Saves an uploaded media file into the specified directory structure. If no save directory is specified, the draft folder is used. The hash can contain the following:
param - the CGI parameter used to reference the upload file stock - file category (used to define the save directory)
Note that this upload function assumes that the file is to be stored in the appropriate directory with a link being return. No imageid or further reference is held within the database.
ADMIN INTERFACE FUNCTIONS
- ImageCheck
-
Used by Images::Delete to verify whether a particular module uses a particular image referenced in the database.
LOCAL INTERNAL FUNCTIONS
- SaveImage
-
Writes image data to the database.
- UnZipFile
-
Un wraps an archive file and stores it in an appropriate directory. For a single file archive, the path to the file is returned. For collecions of files, an 'index.html' is searched for and the path to it returned if found. In all other instances the either the path to the first HTML file or first other file is returned.
SEE ALSO
Labyrinth
AUTHOR
Barbie, <barbie@missbarbell.co.uk> for Miss Barbell Productions, http://www.missbarbell.co.uk/
COPYRIGHT & LICENSE
Copyright (C) 2002-2011 Barbie for Miss Barbell Productions
All Rights Reserved.
This module is free software; you can redistribute it and/or
modify it under the Artistic License 2.0.