From 0d970a2a4e58ffa61f4c2b8defc6149efc32680d Mon Sep 17 00:00:00 2001 From: jygaulier Date: Wed, 17 Jul 2024 16:52:25 +0200 Subject: [PATCH] ignore metadata-reader exception (#4532) --- lib/Alchemy/Phrasea/Border/Manager.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/lib/Alchemy/Phrasea/Border/Manager.php b/lib/Alchemy/Phrasea/Border/Manager.php index de52ea8878..001974d863 100644 --- a/lib/Alchemy/Phrasea/Border/Manager.php +++ b/lib/Alchemy/Phrasea/Border/Manager.php @@ -31,6 +31,7 @@ use Alchemy\Phrasea\Model\Entities\LazaretCheck; use Alchemy\Phrasea\Model\Entities\LazaretFile; use Alchemy\Phrasea\Model\Entities\LazaretSession; +use Exception; use PHPExiftool\Driver\Metadata\Metadata; use PHPExiftool\Driver\Value\Mono as MonoValue; use PHPExiftool\Driver\Value\Multi; @@ -445,11 +446,16 @@ protected function createLazaret(File $file, Visa $visa, LazaretSession $session */ protected function addMediaAttributes(File $file) { - $metadataCollection = $this->app['phraseanet.metadata-reader']->read($file->getMedia()); + try { + $metadataCollection = $this->app['phraseanet.metadata-reader']->read($file->getMedia()); - array_walk($metadataCollection, function (Metadata $metadata) use ($file) { - $file->addAttribute(new MetadataAttr($metadata)); - }); + array_walk($metadataCollection, function (Metadata $metadata) use ($file) { + $file->addAttribute(new MetadataAttr($metadata)); + }); + } + catch (Exception $e) { + // ingore + } return $this; }