ILIAS  release_8 Revision v8.24
ilImageMagickRenderer Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. 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 (\ilPreview $preview)
 Determines whether the specified preview object is supported by the renderer. More...
 
 prepareFileForExec (string $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 (\ilPreview $preview)
 Determines whether the specified preview object is supported by the renderer. More...
 
 render (\ilPreview $preview, \ilObject $obj, bool $async)
 Creates the preview of the specified preview object. More...
 

Static Public Member Functions

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

Protected Member Functions

 renderImages (\ilObject $obj)
 Renders the specified object into images. More...
 
- Protected Member Functions inherited from ilPreviewRenderer
 renderImages (\ilObject $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...
 

Private Attributes

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

Static Private Attributes

static array $supported_formats = null
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning 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 26 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 54 of file class.ilImageMagickRenderer.php.

54 : array
55 {
56 return explode(",", self::SUPPORTED_FORMATS) ?? [];
57 }

Referenced by getSupportedFileFormats().

+ Here is the caller graph for this function:

◆ 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.

Reimplemented from ilFilePreviewRenderer.

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

39 : array
40 {
41 // build formats only once
42 if (!isset(self::$supported_formats)) {
43 self::$supported_formats = self::evaluateSupportedFileFormats();
44 }
45
47 }
static evaluateSupportedFileFormats()
Evaluates the supported file formats.

References $supported_formats, and evaluateSupportedFileFormats().

+ Here is the call graph for this function:

◆ renderImages()

ilImageMagickRenderer::renderImages ( \ilObject  $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 66 of file class.ilImageMagickRenderer.php.

66 : array
67 {
68 $filepath = $obj->getFile();
69 $tmpPath = $this->prepareFileForExec($filepath);
70 $isTemporary = $tmpPath !== $filepath;
71 return array(new ilRenderedImage($tmpPath, $isTemporary));
72 }
prepareFileForExec(string $filepath)
Checks whether the specified file path can be used with exec() commands.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References ilFilePreviewRenderer\prepareFileForExec().

+ Here is the call graph for this function:

Field Documentation

◆ $supported_formats

array ilImageMagickRenderer::$supported_formats = null
staticprivate

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

Referenced by getSupportedFileFormats().

◆ SUPPORTED_FORMATS

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

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


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