public function extract($pathfile, $outputDir)
{
if (!file_exists($pathfile)) {
throw new LogicException(sprintf('%s does not exists', $pathfile));
}
if (!is_dir($outputDir) || !is_writable($outputDir)) {
throw new LogicException(sprintf('%s is not writable', $outputDir));
}
$command = "-if " . escapeshellarg('$photoshopthumbnail') . " -b -PhotoshopThumbnail " . "-w " . escapeshellarg(realpath($outputDir) . '/PhotoshopThumbnail%c.jpg') . " -execute " . "-if " . escapeshellarg('$jpgfromraw') . " -b -jpgfromraw " . "-w " . escapeshellarg(realpath($outputDir) . '/JpgFromRaw%c.jpg') . " -execute " . "-if " . escapeshellarg('$previewimage') . " -b -previewimage " . "-w " . escapeshellarg(realpath($outputDir) . '/PreviewImage%c.jpg') . " " . "-common_args -q -m " . $pathfile;
try {
$this->exiftool->executeCommand($command);
} catch (RuntimeException $e) {
}
return new \DirectoryIterator($outputDir);
}