i have the following problem:
I work in maintenance in a new inherited project. In this project the developers work on metadata of image and video in this way:
function getRotationFromFile($realPath) {
$retVal = Array();
$cmd = variable_get("exiftool",null) . "\"$realPath\"" . " | grep -E 'Rotation|Camera Identifier'";
exec($cmd, $output);
foreach ($output as $row){
$key = trim(strstr($row, ':', true));
$value = trim(str_replace(": ", "", strstr($row, ': ')));
$retVal[$key] = $value;
}
return $retVal;
}
As you can read, this function, call the exec(exiftool..) and retrieve some metadata. I know that in php exists exif_read_data, that done the same.
My questions are:
- What is the best solution?
- Who is the faster one?
- Who is the more "correct" one?
- Finally, i try to search but i don't find if exif_read_data use exiftool in source
Thank you in advance!