49         bool $a_constrain_prop = 
false    51         if ($a_constrain_prop) {
    52             $size = 
" -geometry " . $a_width . 
"x" . $a_height . 
" ";
    54             $size = 
" -resize " . $a_width . 
"x" . $a_height . 
"! ";
    69         return escapeshellarg($a_arg);
    80         if (preg_match(
"/([0-9]+)\.([0-9]+)\.([0-9]+)([\.|\-]([0-9]+))?/", $a_version, $match)) {
    81             $version = str_pad($match[1], 2, 
"0", STR_PAD_LEFT) .
    82                 str_pad($match[2], 2, 
"0", STR_PAD_LEFT) .
    83                 str_pad($match[3], 2, 
"0", STR_PAD_LEFT) .
    84                 str_pad($match[5], 2, 
"0", STR_PAD_LEFT);
    95         if (ini_get(
'safe_mode') == 1) {
   103         return escapeshellcmd($a_arg);
   109     public static function execQuoted(
string $cmd, ?
string $args = null): array
   113         if (
ilUtil::isWindows() && strpos($cmd, 
" ") !== 
false && substr($cmd, 0, 1) !== 
'"') {
   115             $cmd = 
'"' . $cmd . 
'"';
   119                 if (version_compare(phpversion(), 
"5.2", 
"<") && strpos($args, 
'"') !== 
false) {
   120                     $cmd = 
'"' . $cmd . 
" " . $args . 
'"';
   132         $DIC->logger()->root()->debug(
"ilUtil::execQuoted: " . $cmd . 
".");
   142         $current_version = self::processConvertVersion($current_version[0]);
   143         $version = self::processConvertVersion($a_version);
   155         return PATH_TO_CONVERT;
   164         string $a_target_format = 
"",
   165         string $a_geometry = 
"",
   166         string $a_background_color = 
""   168         $format_str = ($a_target_format != 
"")
   169             ? strtoupper($a_target_format) . 
":"   172         if ($a_geometry != 
"") {
   173             if (is_int(strpos($a_geometry, 
"x"))) {
   174                 $geometry = 
" -geometry " . $a_geometry . 
" ";
   176                 $geometry = 
" -geometry " . $a_geometry . 
"x" . $a_geometry . 
" ";
   180         $bg_color = ($a_background_color != 
"")
   181             ? 
" -background color " . $a_background_color . 
" "   198         $args = self::escapeShellCmd($args);
 
static isConvertVersionAtLeast(string $a_version)
 
static processConvertVersion(string $a_version)
Parse convert version string, e.g. 
 
static escapeShellArg(string $a_arg)
 
static convertImage(string $a_from, string $a_to, string $a_target_format="", string $a_geometry="", string $a_background_color="")
 
static execQuoted(string $cmd, ?string $args=null)
 
static escapeShellCmd(string $a_arg)
 
static execConvert(string $args)
execute convert command 
 
static resizeImage(string $a_from, string $a_to, int $a_width, int $a_height, bool $a_constrain_prop=false)
resize image