Catch exception when PHP exiftool does not write file type

This commit is contained in:
Romain Neutron
2012-05-15 16:47:51 +02:00
parent 076f0317b5
commit 1a16f2d74e

View File

@@ -129,7 +129,14 @@ class File
$metadatas->add(new Metadata(TagFactory::getFromRDFTagname($tagname), $value));
}
$writer->write($this->getFile()->getRealPath(), $metadatas);
/**
* PHPExiftool throws exception on some files not supported
*/
try {
$writer->write($this->getFile()->getRealPath(), $metadatas);
} catch (\PHPExiftool\Exception\Exception $e) {
}
}
$writer = $reader = $metadatas = null;