binary , $this->escapeshellargs($origine->getPathname()) ); $stdout = $this->shell_cmd($cmd); $id = false; foreach ($stdout as $l) { if (substr(trim($l), 0, 4) == '[-j]') { $id = ' -j ' . array_pop(explode('-', array_pop(explode(' ', trim($l))))); $ext = '.jpg'; break; } if (substr(trim($l), 0, 4) == '[-p]') { $id = ' -p ' . array_pop(explode('-', array_pop(explode(' ', trim($l))))); $ext = '.png'; break; } } if ($id) { $cmd = sprintf('%s %s %s -o %s' , $this->binary , $id , $this->escapeshellargs($origine->getPathname()) , $this->escapeshellargs($dest) ); $this->shell_cmd($cmd); } return $this; } }