From 564f0ee9b81e8067b974f8c96a56179cd6c61015 Mon Sep 17 00:00:00 2001 From: Andy Heathershaw Date: Fri, 28 Oct 2016 15:28:25 +0100 Subject: [PATCH] BLUE-5: Look for a DateTimeOriginal tag first before the DateTime flag to identify the actual taken date --- app/Http/Requests/UpdatePhotosBulkRequest.php | 37 +++++++++++++++++++ app/Services/PhotoService.php | 6 ++- 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 app/Http/Requests/UpdatePhotosBulkRequest.php diff --git a/app/Http/Requests/UpdatePhotosBulkRequest.php b/app/Http/Requests/UpdatePhotosBulkRequest.php new file mode 100644 index 0000000..7267b2f --- /dev/null +++ b/app/Http/Requests/UpdatePhotosBulkRequest.php @@ -0,0 +1,37 @@ + 'required', + ]; + } + + public function messages() + { + return [ + 'photo.*.name.required' => trans('validation.photo_name_required') + ]; + } +} diff --git a/app/Services/PhotoService.php b/app/Services/PhotoService.php index fddc6e5..60a4282 100644 --- a/app/Services/PhotoService.php +++ b/app/Services/PhotoService.php @@ -302,7 +302,11 @@ class PhotoService private function metadataDateTime(array $exifData) { $dateTime = null; - if (isset($exifData['DateTime'])) + if (isset($exifData['DateTimeOriginal'])) + { + $dateTime = $exifData['DateTimeOriginal']; + } + else if (isset($exifData['DateTime'])) { $dateTime = $exifData['DateTime']; }