binary , $this->escapeshellargs($raw_datas->getPathname()) ); $out = $this->shell_cmd($cmd); if (!$out) throw new Exception('Unable to extract preview datas from audio'); foreach ($out as $outP) { $infos = explode("\t", $outP); if (count($infos) != 2 || $infos[0] != 'Picture') continue; $this->log("Some preview datas found in audio file"); $cmd = sprintf('%s -b -Picture %s > %s' , $this->binary , $this->escapeshellargs($raw_datas->getPathname()) , $this->escapeshellargs($dest) ); $this->shell_cmd($cmd); if (filesize($dest) > 0) { return $this; } else { unlink($dest); } } } }