if (!
preg_match('/convert$/i',
$this->config->libraryPath
)) { $this->config->libraryPath =
rtrim($this->config->libraryPath, '/'
) . '/convert';
} $cmd =
$this->config->libraryPath;
$cmd .=
$action === '-version' ? ' ' .
$action : ' -quality ' .
$quality . ' ' .
$action;
$retval = 1;
$output =
[];
// exec() might be disabled
if (function_usable('exec'
)) { @
exec($cmd,
$output,
$retval);
} // Did it work?
if ($retval > 0
) { throw ImageException::
forImageProcessFailed();
} return $output;
}