ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilImageMagickRenderer Class Reference

Preview renderer class that is able to create previews from images by using ImageMagick. More...

+ Inheritance diagram for ilImageMagickRenderer:
+ Collaboration diagram for ilImageMagickRenderer:

Public Member Functions

 getSupportedFileFormats ()
 Gets an array containing the file formats that are supported by the renderer.
- Public Member Functions inherited from ilFilePreviewRenderer
 getSupportedRepositoryTypes ()
 Gets an array containing the repository types (e.g.
 supports ($preview)
 Determines whether the specified preview object is supported by the renderer.
 prepareFileForExec ($filepath)
 Checks whether the specified file path can be used with exec() commands.
- Public Member Functions inherited from ilPreviewRenderer
 getName ()
 Gets the name of the renderer.
 isPlugin ()
 Determines whether the renderer is a plugin or a built in one.
 render ($preview, $obj, $async)
 Creates the preview of the specified preview object.

Static Public Member Functions

static evaluateSupportedFileFormats ()
 Evaluates the supported file formats.

Data Fields

const SUPPORTED_FORMATS = "jpg,jpeg,jp2,png,gif,bmp,tif,tiff,cur,ico,pict,tga,psd"

Protected Member Functions

 renderImages ($obj)
 Renders the specified object into images.

Static Private Attributes

static $supported_formats = null

Detailed Description

Preview renderer class that is able to create previews from images by using ImageMagick.

Author
Stefan Born stefa.nosp@m.n.bo.nosp@m.rn@ph.nosp@m.zh.c.nosp@m.h
Version
$Id$

Definition at line 14 of file class.ilImageMagickRenderer.php.

Member Function Documentation

static ilImageMagickRenderer::evaluateSupportedFileFormats ( )
static

Evaluates the supported file formats.

Returns
array An array containing the supported file formats.

Definition at line 41 of file class.ilImageMagickRenderer.php.

Referenced by getSupportedFileFormats().

{
$formats = explode(",", self::SUPPORTED_FORMATS);
return $formats;
}

+ Here is the caller graph for this function:

ilImageMagickRenderer::getSupportedFileFormats ( )

Gets an array containing the file formats that are supported by the renderer.

Returns
array An array containing the supported file formats.

Reimplemented from ilFilePreviewRenderer.

Definition at line 27 of file class.ilImageMagickRenderer.php.

References $supported_formats, and evaluateSupportedFileFormats().

{
// build formats only once
if (self::$supported_formats == null)
self::$supported_formats = self::evaluateSupportedFileFormats();
}

+ Here is the call graph for this function:

ilImageMagickRenderer::renderImages (   $obj)
protected

Renders the specified object into images.

The images do not need to be of the preview image size.

Parameters
ilObjFile$objThe object to create images from.
Returns
array An array of ilRenderedImage containing the absolute file paths to the images.

Reimplemented from ilPreviewRenderer.

Definition at line 54 of file class.ilImageMagickRenderer.php.

References ilFilePreviewRenderer\prepareFileForExec().

{
$filepath = $obj->getFile();
$tmpPath = $this->prepareFileForExec($filepath);
$isTemporary = $tmpPath != $filepath;
return array(new ilRenderedImage($tmpPath . "[0]", $isTemporary));
}

+ Here is the call graph for this function:

Field Documentation

ilImageMagickRenderer::$supported_formats = null
staticprivate

Definition at line 20 of file class.ilImageMagickRenderer.php.

Referenced by getSupportedFileFormats().

const ilImageMagickRenderer::SUPPORTED_FORMATS = "jpg,jpeg,jp2,png,gif,bmp,tif,tiff,cur,ico,pict,tga,psd"

Definition at line 17 of file class.ilImageMagickRenderer.php.


The documentation for this class was generated from the following file: