BLUE-5: Look for a DateTimeOriginal tag first before the DateTime flag to identify the actual taken date

This commit is contained in:
Andy Heathershaw 2016-10-28 15:28:25 +01:00
parent aa9eee9bf5
commit 564f0ee9b8
2 changed files with 42 additions and 1 deletions

View File

@ -0,0 +1,37 @@
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class UpdatePhotosBulkRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'photo.*.name' => 'required',
];
}
public function messages()
{
return [
'photo.*.name.required' => trans('validation.photo_name_required')
];
}
}

View File

@ -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'];
}