Merged in BLUE-5-modified-photos-dont-retain-their (pull request #2)

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 14:29:15 +00:00
commit 975c4938b4
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'];
}