function SimpleExifToolFacade::runTool in Exif 7
Same name and namespace in other branches
- 8.2 src/SimpleExifToolFacade.php \Drupal\exif\SimpleExifToolFacade::runTool()
- 8 src/SimpleExifToolFacade.php \Drupal\exif\SimpleExifToolFacade::runTool()
1 call to SimpleExifToolFacade::runTool()
File
- ./
SimpleExiftoolFacade.php, line 95
Class
Namespace
Drupal\exifCode
function runTool($file, $enable_sections = true, $enable_markerNote = false, $enable_non_supported_tags = false) {
$params = "";
if ($enable_sections) {
$params = "-g -struct ";
}
if ($enable_markerNote) {
$params = $params . "-fast ";
}
else {
$params = $params . "-fast2 ";
}
if ($enable_non_supported_tags) {
$params = $params . " -u -U";
}
$commandline = "exiftool -E -n -json " . $params . "\"" . $file . "\"";
$output = array();
$returnCode = 0;
exec($commandline, $output, $returnCode);
//print_r($output);
if ($returnCode != 0) {
$output = "";
watchdog('exif', 'Exiftool returns an error. Can not extract metadata from file !file', array(
'!file' => $file,
), WATCHDOG_WARNING);
}
$info = implode("\n", $output);
return $info;
}