Skip to content

Commit

Permalink
ignore metadata-reader exception (#4532)
Browse files Browse the repository at this point in the history
  • Loading branch information
jygaulier authored Jul 17, 2024
1 parent b0601b9 commit 0d970a2
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions lib/Alchemy/Phrasea/Border/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 0d970a2

Please sign in to comment.