TYPO3 CMS  TYPO3_6-2
ImageMagick6Preset.php
Go to the documentation of this file.
1 <?php
3 
18 
23 
27  protected $name = 'ImageMagick6';
28 
32  protected $priority = 70;
33 
37  protected $configurationValues = array(
38  'GFX/image_processing' => 1,
39  'GFX/im' => 1,
40  // im_path and im_path_lzw are determined and set by path lookup methods
41  'GFX/im_path' => '',
42  'GFX/im_path_lzw' => '',
43  'GFX/im_version_5' => 'im6',
44  'GFX/im_v5effects' => 1,
45  'GFX/im_mask_temp_ext_gif' => 1,
46  'GFX/colorspace' => 'sRGB',
47  );
48 
55  protected function findExecutableInPath(array $searchPaths) {
56  return $this->findImageMagick6InPaths($searchPaths);
57  }
58 
65  protected function findImageMagick6InPaths(array $searchPaths) {
66  $result = FALSE;
67  foreach ($searchPaths as $path) {
68  if (TYPO3_OS === 'WIN') {
69  $executable = 'identify.exe';
70  } else {
71  $executable = 'identify';
72  }
73  if (@is_file($path . $executable)) {
74  $command = escapeshellarg($path . $executable) . ' -version';
75  $executingResult = FALSE;
76  \TYPO3\CMS\Core\Utility\CommandUtility::exec($command, $executingResult);
77  // First line of exec command should contain string GraphicsMagick
78  $firstResultLine = array_shift($executingResult);
79  // Example: "Version: ImageMagick 6.6.0-4 2012-05-02 Q16 http://www.imagemagick.org"
80  if (strpos($firstResultLine, 'ImageMagick') !== FALSE) {
81  list(,$version) = explode('ImageMagick', $firstResultLine);
82  // Example: "6.6.0-4"
83  list($version) = explode(' ', trim($version));
84  if (version_compare($version, '6.0.0') >= 0) {
85  $this->foundPath = $path;
86  $result = TRUE;
87  break;
88  }
89  }
90  }
91  }
92  return $result;
93  }
94 }
if($list_of_literals) if(!empty($literals)) if(!empty($literals)) $result
Analyse literals to prepend the N char to them if their contents aren&#39;t numeric.
static exec($command, &$output=NULL, &$returnValue=0)