mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-23 18:03:17 +00:00
Merge pull request #3142 from aynsix/PHRAS-2709-port-date-from-iptc
PHRAS-2709 : port to 4.1 Dates seems not extracted from iptc
This commit is contained in:
@@ -14,6 +14,7 @@ namespace Alchemy\Phrasea\Metadata;
|
|||||||
use Alchemy\Phrasea\Border\File;
|
use Alchemy\Phrasea\Border\File;
|
||||||
use Alchemy\Phrasea\Databox\DataboxRepository;
|
use Alchemy\Phrasea\Databox\DataboxRepository;
|
||||||
use Alchemy\Phrasea\Metadata\Tag\NoSource;
|
use Alchemy\Phrasea\Metadata\Tag\NoSource;
|
||||||
|
use DateTime;
|
||||||
use PHPExiftool\Driver\Metadata\Metadata;
|
use PHPExiftool\Driver\Metadata\Metadata;
|
||||||
|
|
||||||
class PhraseanetMetadataSetter
|
class PhraseanetMetadataSetter
|
||||||
@@ -66,8 +67,16 @@ class PhraseanetMetadataSetter
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
$data['value'] = $value;
|
if ($field->get_type() == 'date') {
|
||||||
|
try {
|
||||||
|
$dateTime = new DateTime($value);
|
||||||
|
$value = $dateTime->format('Y/m/d H:i:s');
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
// $value unchanged
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$data['value'] = $value;
|
||||||
$metadataInRecordFormat[] = $data;
|
$metadataInRecordFormat[] = $data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user