Skip to content

Commit

Permalink
[VD:abstract] fix Studio-42#3167 added "none" (no image library check…
Browse files Browse the repository at this point in the history
…) to `imgLib` option value
  • Loading branch information
nao-pon committed May 31, 2020
1 parent ad27e93 commit 04720e4
Showing 1 changed file with 19 additions and 15 deletions.
34 changes: 19 additions & 15 deletions php/elFinderVolumeDriver.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ abstract class elFinderVolumeDriver
'tmbBgColor' => 'transparent',
// image rotate fallback background color (hex #rrggbb)
'bgColorFb' => '#ffffff',
// image manipulations library
// image manipulations library (imagick|gd|convert|auto|none, none - Does not check the image library at all.)
'imgLib' => 'auto',
// Fallback self image to thumbnail (nothing imgLib)
'tmbFbSelf' => true,
Expand Down Expand Up @@ -863,26 +863,30 @@ protected function configure()
}

// set image manipulation library
$type = preg_match('/^(imagick|gd|convert|auto)$/i', $this->options['imgLib'])
$type = preg_match('/^(imagick|gd|convert|auto|none)$/i', $this->options['imgLib'])
? strtolower($this->options['imgLib'])
: 'auto';

if (($type === 'imagick' || $type === 'auto') && extension_loaded('imagick')) {
$this->imgLib = 'imagick';
} else if (($type === 'gd' || $type === 'auto') && function_exists('gd_info')) {
$this->imgLib = 'gd';
if ($type === 'none') {
$this->imgLib = '';
} else {
$convertCache = 'imgLibConvert';
if (($convertCmd = $this->session->get($convertCache, false)) !== false) {
$this->imgLib = $convertCmd;
if (($type === 'imagick' || $type === 'auto') && extension_loaded('imagick')) {
$this->imgLib = 'imagick';
} else if (($type === 'gd' || $type === 'auto') && function_exists('gd_info')) {
$this->imgLib = 'gd';
} else {
$this->imgLib = ($this->procExec(ELFINDER_CONVERT_PATH . ' -version') === 0) ? 'convert' : '';
$this->session->set($convertCache, $this->imgLib);
$convertCache = 'imgLibConvert';
if (($convertCmd = $this->session->get($convertCache, false)) !== false) {
$this->imgLib = $convertCmd;
} else {
$this->imgLib = ($this->procExec(ELFINDER_CONVERT_PATH . ' -version') === 0) ? 'convert' : '';
$this->session->set($convertCache, $this->imgLib);
}
}
if ($type !== 'auto' && $this->imgLib === '') {
// fallback
$this->imgLib = extension_loaded('imagick') ? 'imagick' : (function_exists('gd_info') ? 'gd' : '');
}
}
if ($type !== 'auto' && $this->imgLib === '') {
// fallback
$this->imgLib = extension_loaded('imagick') ? 'imagick' : (function_exists('gd_info') ? 'gd' : '');
}

// check video to img converter
Expand Down

0 comments on commit 04720e4

Please sign in to comment.