ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilImageMagickRenderer.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2012 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 include_once("./Services/Preview/classes/class.ilFilePreviewRenderer.php");
5 
15 {
16  // constants
17  const SUPPORTED_FORMATS = "jpg,jpeg,jp2,png,gif,bmp,tif,tiff,cur,ico,pict,tga,psd";
18 
19  // variables
20  private static $supported_formats = null;
21 
27  public function getSupportedFileFormats()
28  {
29  // build formats only once
30  if (self::$supported_formats == null) {
31  self::$supported_formats = self::evaluateSupportedFileFormats();
32  }
33 
34  return self::$supported_formats;
35  }
36 
42  public static function evaluateSupportedFileFormats()
43  {
44  $formats = explode(",", self::SUPPORTED_FORMATS);
45  return $formats;
46  }
47 
55  protected function renderImages($obj)
56  {
57  $filepath = $obj->getFile();
58  $tmpPath = $this->prepareFileForExec($filepath);
59  $isTemporary = $tmpPath != $filepath;
60  return array(new ilRenderedImage($tmpPath . "[0]", $isTemporary));
61  }
62 }
Preview renderer class that is able to create previews from images by using ImageMagick.
prepareFileForExec($filepath)
Checks whether the specified file path can be used with exec() commands.
Abstract parent class for all file preview renderer classes.
getSupportedFileFormats()
Gets an array containing the file formats that are supported by the renderer.
renderImages($obj)
Renders the specified object into images.
Represents an image that was created from a preview renderer and that can be further processed to cre...
Create styles array
The data for the language used.
$formats
Definition: date.php:77
static evaluateSupportedFileFormats()
Evaluates the supported file formats.