From 5996e590bc592616654ca2895f1a664531a3bcf1 Mon Sep 17 00:00:00 2001 From: Romain Neutron Date: Wed, 9 Oct 2013 12:18:16 +0200 Subject: [PATCH] Reset exiftool writer before writing --- lib/Alchemy/Phrasea/Border/File.php | 1 + lib/classes/task/period/writemeta.php | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Alchemy/Phrasea/Border/File.php b/lib/Alchemy/Phrasea/Border/File.php index f05e62a7e7..fab6ff7fd2 100644 --- a/lib/Alchemy/Phrasea/Border/File.php +++ b/lib/Alchemy/Phrasea/Border/File.php @@ -143,6 +143,7 @@ class File * PHPExiftool throws exception on some files not supported */ try { + $this->app['exiftool.writer']->reset(); $this->app['exiftool.writer']->write($this->getFile()->getRealPath(), $metadatas); } catch (PHPExiftoolException $e) { diff --git a/lib/classes/task/period/writemeta.php b/lib/classes/task/period/writemeta.php index 14f5e21f98..159e25fe3a 100644 --- a/lib/classes/task/period/writemeta.php +++ b/lib/classes/task/period/writemeta.php @@ -303,9 +303,10 @@ class task_period_writemeta extends task_databoxAbstract ); } + $this->dependencyContainer['exiftool.writer']->reset(); foreach ($tsub as $name => $file) { - $this->dependencyContainer['exiftool.writer']->erase($name != 'document' || $this->clear_doc); + $this->dependencyContainer['exiftool.writer']->erase($name != 'document' || $this->clear_doc, true); try { $this->dependencyContainer['exiftool.writer']->write($file, $metadatas);