From 1a16f2d74e75e17da2517cfcb0c9affdc1a75800 Mon Sep 17 00:00:00 2001 From: Romain Neutron Date: Tue, 15 May 2012 16:47:51 +0200 Subject: [PATCH] Catch exception when PHP exiftool does not write file type --- lib/Alchemy/Phrasea/Border/File.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/Alchemy/Phrasea/Border/File.php b/lib/Alchemy/Phrasea/Border/File.php index 0454831856..4f364e5b95 100644 --- a/lib/Alchemy/Phrasea/Border/File.php +++ b/lib/Alchemy/Phrasea/Border/File.php @@ -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;