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

Static Public Member Functions

static evaluateSupportedFileFormats ()
 Evaluates the supported file formats. More...
 

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. More...
 
- Protected Member Functions inherited from ilPreviewRenderer
 renderImages ($obj)
 Renders the specified object into images. More...
 
 getImageSize ()
 Gets the size of the preview images in pixels. More...
 
 getImageQuality ()
 Gets the quality (compression) of the preview images (1-100). More...
 
 getMaximumNumberOfPreviews ()
 Gets the maximum number of preview pictures per object. More...
 

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

◆ evaluateSupportedFileFormats()

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.

42  {
43  $formats = explode(",", self::SUPPORTED_FORMATS);
44  return $formats;
45  }

◆ getSupportedFileFormats()

ilImageMagickRenderer::getSupportedFileFormats ( )

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

Returns
array An array containing the supported file formats.

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

28  {
29  // build formats only once
30  if (self::$supported_formats == null)
31  self::$supported_formats = self::evaluateSupportedFileFormats();
32 
33  return self::$supported_formats;
34  }

◆ renderImages()

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.

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

References ilFilePreviewRenderer\prepareFileForExec().

55  {
56  $filepath = $obj->getFile();
57  $tmpPath = $this->prepareFileForExec($filepath);
58  $isTemporary = $tmpPath != $filepath;
59  return array(new ilRenderedImage($tmpPath . "[0]", $isTemporary));
60  }
prepareFileForExec($filepath)
Checks whether the specified file path can be used with exec() commands.
Represents an image that was created from a preview renderer and that can be further processed to cre...
+ Here is the call graph for this function:

Field Documentation

◆ $supported_formats

ilImageMagickRenderer::$supported_formats = null
staticprivate

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

◆ SUPPORTED_FORMATS

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: